PATH:
home
/
letacommog
/
letaweb
/
admin
/
classes
<?php /** * Controller is the customized base controller class. * All controller classes for this application should extend from this base class. */ class PController extends CController { /** * @var string the default layout for the controller view. Defaults to 'column1', * meaning using a single column layout. See 'protected/views/layouts/column1.php'. */ public $layout = 'column4'; /** * @var array context menu items. This property will be assigned to {@link CMenu::items}. */ public $menu = array(); /** * @var array the breadcrumbs of the current page. The value of this property will * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links} * for more details on how to specify this property. */ public $language_terms = array(); public $breadcrumbs = array(); public function beforeRender($view) { parent::beforeRender($view); Yii::app()->runComponent('beforeRender',$view); return true; } public function afterRender($view, &$output) { parent::afterRender($view, $output); Yii::app()->runComponent('afterRender',$view); ///return true; } public function initShortcodes() { if(!isset(Yii::app()->shortcode)) return; $path = ('site_app.shortcodes'); if(!file_exists(Yii::getPathofAlias($path))) { $path = ('application.shortcodes'); } //Yii::import($path.'.*'); foreach(glob(Yii::getPathofAlias($path). DIRECTORY_SEPARATOR.'*_src.php') as $file) { $filename = basename($file); $shortcode_id = str_replace('_src.php', '',$filename); Yii::app()->shortcode->add_shortcode($shortcode_id, array($this, 'shortcode_callback')); } } public function shortcode_callback($attrs, $m,$tag) { //extract( Yii::app()->shortcode->shortcode_atts( $attrs, $attrs ) ); $path = ('site_app.shortcodes'); if(!file_exists(Yii::getPathofAlias($path))) { $path = ('application.shortcodes'); } return $this->renderPartial($path.'.'.$tag.'_src', array('attrs'=>$attrs, 'shortcode_id'=>$tag), true); } public function processOutput($output) { if(isset(Yii::app()->shortcode)) $output = Yii::app()->shortcode->parse($output); return parent::processOutput($output); } public function init() { $params = ''; parent::init(); @include_once Yii::getPathofAlias('application.classes.general').'.php'; @include_once Yii::getPathofAlias('site_app.classes.general').'.php'; $app = Yii::app(); if (isset(Yii::app()->params['language'])) { $app->language = Yii::app()->params['language']; } elseif (isset($app->session['_lang'])) { $app->language = $app->session['_lang']; } else { $lang = substr(Yii::app()->getRequest()->getPreferredLanguage(), 0, 2); if (isset(Yii::app()->request->cookies['lang'])) { $lang = Yii::app()->request->cookies['lang']->value; } $app->language = $lang; $app->session['_lang'] = $lang; } $this->initShortcodes(); //$app->session['dfdfdsfdsf']; Yii::app()->runComponent('afterControllerInit', $params); if(@class_exists('cmm_system')) { //cmm_system::init(); //cmm_system::run('load_dependencies'); } } public function beforeAction($view) { parent::beforeAction($view); Yii::app()->runComponent('beforeAction',$view); if(isset(Yii::app()->ecommerce)) { //Yii::app()->ecommerce->beforeRender(); } return true; } public function afterAction($view) { parent::afterAction($view); Yii::app()->runComponent('afterAction',$view); if(isset(Yii::app()->ecommerce)) { //Yii::app()->ecommerce->afterRender(); } } public function t($key) { if (isset(Yii::app()->lang)) { Yii::app()->lang->t($key); } } public function term($key) { if (isset(Yii::app()->lang)) { return Yii::app()->lang->term($key); } } public function ajaxSuccess($data) { $rs = array('success' => true, 'data' => $data); echo json_encode($rs); } public function ajaxError($msg = '') { $rs = array('success' => false, 'type' => 1, 'message' => $msg); echo json_encode($rs); } public function ajaxLoginRequired($msg = '') { $rs = array('success' => false, 'type' => 2, 'message' => $msg); echo json_encode($rs); } public function JWTValidate() { $requestHeaders = Functions::apache_request_headers(); $authorizationHeader = $requestHeaders['AUTHORIZATION']; if ($authorizationHeader == null) { header('HTTP/1.0 401 Unauthorized'); echo 'No authorization header sent'; exit(); } // // validate the token $token = str_replace('Bearer ', '', $authorizationHeader); $secret = 'YOUR_CLIENT_SECRET'; $decoded_token = null; try { $decoded_token = JWT::decode($token, base64_decode(strtr($secret, '-_', '+/'))); } catch (UnexpectedValueException $ex) { header('HTTP/1.0 401 Unauthorized'); echo 'Invalid token'; exit(); } // // validate that this token was made for us if ($decoded_token->aud != 'YOUR_CLIENT_ID0') { header('HTTP/1.0 401 Unauthorized'); echo 'Invalid token'; exit(); } } }
[+]
..
[+]
php-jwt
[-] Blowfish.php
[edit]
[+]
socialEmbed
[+]
mailchimp
[+]
swiftMailer
[-] CMS_Rewrite.php
[edit]
[+]
hosting
[-] general.php
[edit]
[-] ScreenShot.php
[edit]
[-] UrlManager.php
[edit]
[+]
payments
[-] Configuration.php
[edit]
[+]
twig-renderer-master
[-] Functions.php
[edit]
[+]
twig
[+]
addons
[+]
hoauth
[-] package.xml
[edit]
[-] PController.php
[edit]
[-] ETwigViewRenderer.php
[edit]
[+]
htmlpurifier
[-] Randomness.php
[edit]
[-] CSSParser.php
[edit]
[-] Mail.php
[edit]
[-] Rijndael.php
[edit]
[+]
components
[+]
rss
[-] WebApplication.php
[edit]
[-] passwordhash.php
[edit]
[-] DLDatabaseHelper.php
[edit]
[+]
Exceptions