function init($request)
 {
     parent::init($request);
     $ck = new Cookie(COOKIE_NAME_SESSION);
     $ck->delete();
     Request::redirectToModule('index');
 }
 public function init()
 {
     parent::init();
     Yii::app()->params['forum_max_crumb_length'] = 40;
     Yii::app()->params['forum_max_latest_reply_length'] = 30;
     Yii::app()->params['forum_pageSize'] = 20;
 }
Example #3
0
 public static function run()
 {
     if (!Site::init(!empty($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : '')) {
         @header('HTTP/1.1 404 Not Found');
         exit;
     }
     $method = Core::getRequestMethod();
     if (!in_array($method, array('get', 'put', 'delete', 'post'))) {
         @header("HTTP/1.1 501 Not Implemented");
         exit;
     }
     $data = Core::getRequestData();
     if (empty($data[$method]) && !in_array($_SERVER['REQUEST_URI'], array($_SERVER['SCRIPT_NAME'], "", "/"))) {
         $data[$method] = $_SERVER['REQUEST_URI'];
     }
     $resource = Core::getResource($data, $method);
     $staticFolders = array('/cache/', '/static/', '/uploads/', '/vendor/');
     foreach ($staticFolders as $folder) {
         if (strncasecmp($resource, $folder, strlen($folder)) === 0) {
             @header('HTTP/1.1 404 Not Found');
             exit;
         }
     }
     App::set(App::parse($resource));
     Core::resource($resource);
     Module::init();
     $response = Response\Factory::get($resource, $method);
     if (empty($response)) {
         @header('HTTP/1.1 406 Not Acceptable');
         exit;
     }
     Request::init($response, $data);
     echo Request::run($resource, $method);
 }
 /**
  * initialize module with request datas
  * 
  * @param object request
  * @return void
  */
 function init(&$request)
 {
     parent::init($request);
     $this->tpl->caching = 0;
     $this->tpl->mainTemplate = 'admin/structureAdmin.tpl';
     if (isset($this->site)) {
         $this->site->generateFiles();
     }
     // set mod to view because of specific elements in this case (period_selection.tpl)
     $this->tpl->assign('mod', 'admin');
 }
Example #5
0
 public function init()
 {
     parent::init();
     //nested sets tree
     $tree = $this->attachComponent('tree', new dbNestedSetsTree(TABLE_SITEMAP_TREE));
     //        //проверяем наличие корневого элемента
     //        if( $tree->checkRootNode( $nRootID ) )
     //        {
     //если только-что создан, создаем и в "недеревянной" таблице
     //            $this->db->execute('INSERT INTO '.TABLE_SITEMAP.' (node_id, keyword, menu_title, created)
     //                           VALUES('.$nRootID.', '.$this->db->str2sql('root').', '.$this->db->str2sql('Корневой раздел').', '.$this->db->getNOW().')');
     //        }
 }
 function init($request)
 {
     parent::init($request);
     // if tpl is not allocated (which is the case for graphs)
     // and if the login fails, there would be an error here trying to set a template with smarty not constructed
     // so we simply display an error message and exit
     if (!is_a($this->tpl, "TemplateEngine")) {
         print "Error while authentificate, and TemplateEngine not constructed. <br>Exiting...<br>";
         exit;
     }
     $this->tpl->caching = 0;
     $this->tpl->setMainTemplate("common/login.tpl");
 }
 /**
  * initialize module with request datas
  * 
  * @param object request
  * @return void
  */
 function init(&$request, $o_tpl = null, $o_archive = null)
 {
     if (!is_a($o_tpl, "TemplateEngine")) {
         $o_tpl = null;
     }
     parent::init($request, $o_tpl);
     $date = $this->request->getDate();
     if (is_null($this->data)) {
         if (is_null($o_archive)) {
             $o_archive = DataModel::getArchive($this->site, $date, $this->request->getPeriod());
         }
         $this->data = new DataModel($o_archive, $this->request);
     }
     $d = new Date(getDateFromTimestamp(time()));
     if (($this->data->archive->date->get() == $d->get() || isset($this->disableCache)) && is_a($this->tpl, "TemplateEngine")) {
         printDebug("Current date asked is today's date, cache not activated<br>");
         $this->tpl->caching = 0;
     }
 }
Example #8
0
 public function init()
 {
     parent::init();
     $this->items_images_path = bff::buildPath('items', 'images');
     $this->items_images_url = bff::buildUrl('items', 'images');
     # nested sets tree
     $tree = $this->attachComponent('tree', new dbNestedSetsTree(TABLE_BBS_CATEGORIES));
     bff::i()->GetModule('Services');
     if (bff::$isFrontend) {
         return;
     }
     # !
     # проверяем наличие корневого элемента
     if ($tree->checkRootNode($nRootID)) {
         # если только-что создан, создаем категорию
         $this->db->execute('UPDATE ' . TABLE_BBS_CATEGORIES . ' 
                             SET title = ' . $this->db->str2sql('Корневой раздел') . ', created = ' . $this->db->getNOW() . '
                             WHERE id = ' . $nRootID);
     }
     $this->initDynprops();
 }
Example #9
0
 public function init()
 {
     parent::init();
     // custom initialization code goes here
 }
Example #10
0
<?php

namespace ATPCore\Model;

class Module extends \ATP\ActiveRecord
{
    public function displayName()
    {
        return $this->name;
    }
    public function getActiveModules()
    {
        return $this->loadMultiple("is_active = 1");
    }
    public function getActiveModuleNames()
    {
        $names = array();
        foreach ($this->getActiveModules() as $module) {
            $names[] = $module->name;
        }
        return $names;
    }
}
Module::init();
Example #11
0
 public function init()
 {
     Yii::import('application.modules.formdesigner.models.*');
     parent::init();
 }
 public function init()
 {
     parent::init();
 }
    protected function init($page='', $args=array()) {
      
        parent::init();

        $moduleData = $this->getModuleData();
        $this->moduleName = $moduleData['title'];

        $this->setArgs($args);
        $this->setPage($page);
        $this->setTemplatePage($this->page, $this->id);

        $this->pagetype      = $GLOBALS['deviceClassifier']->getPagetype();
        $this->platform      = $GLOBALS['deviceClassifier']->getPlatform();
        $this->supportsCerts = $GLOBALS['deviceClassifier']->getSupportsCerts();

        $this->setAutoPhoneNumberDetection($GLOBALS['siteConfig']->getVar('AUTODETECT_PHONE_NUMBERS'));
        
        // Pull in fontsize
        if (isset($args['font'])) {
          $this->fontsize = $args['font'];
          setcookie('fontsize', $this->fontsize, time() + $this->getSiteVar('LAYOUT_COOKIE_LIFESPAN'), COOKIE_PATH);      
        
        } else if (isset($_COOKIE['fontsize'])) { 
          $this->fontsize = $_COOKIE['fontsize'];
        }

        switch ($this->pagetype) {
          case 'compliant':
            $this->imageExt = '.png';
            break;
            
          case 'touch':
          case 'basic':
            $this->imageExt = '.gif';
            break;
        }
    }
Example #14
0
 public function init()
 {
     parent::init();
     \Yii::configure($this, require __DIR__ . '/config.php');
 }
Example #15
0
 function init()
 {
     global $MOD_TITLE, $MOD_GROUP, $MOD_VISIBLE, $MOD_SUBMENU;
     parent::init($MOD_TITLE, $MOD_GROUP, $MOD_VISIBLE);
     // получаем список лицевых счетов абонента
     $this->accounts = array();
     $this->urfa->call(-16469);
     $this->urfa->send();
     // получаем количество записей
     $count = $this->urfa->get_int();
     for ($i = 0; $i < $count; $i++) {
         $aid = $this->urfa->get_int();
         // номер лицевого счета
         // пропускаем два неинтересных нам параметра
         $this->urfa->get_double();
         // денег на счету
         $this->urfa->get_double();
         // ??
         // добавлем в списков лицевых счетов
         $this->accounts[$aid] = $aid;
     }
     $this->urfa->finish();
     if (isset($_REQUEST['Status'])) {
         $status = $_REQUEST['Status'];
     } else {
         $status = '';
     }
     if ($status == 'pay') {
         // получаем информацию о текущем пользователе
         $this->user = array();
         $this->urfa->call(-0x4052);
         $this->urfa->send();
         $this->user['id'] = $this->urfa->get_int();
         $this->user['login'] = $this->urfa->get_string();
         $this->user['basic_account'] = $this->urfa->get_int();
         $this->user['balance'] = roundDouble($this->urfa->get_double());
         $this->user['credit'] = roundDouble($this->urfa->get_double());
         $this->user['is_blocked'] = resolveBlockState($this->urfa->get_int());
         $this->user['create_date'] = getDateFromTimestamp($this->urfa->get_int());
         $this->user['last_change_date'] = getDateFromTimestamp($this->urfa->get_int());
         $this->user['who_create'] = resolveUserName($this->urfa->get_int());
         $this->user['who_change'] = resolveUserName($this->urfa->get_int());
         $this->user['is_juridical'] = $this->urfa->get_int();
         $this->user['full_name'] = $this->urfa->get_string();
         $accountId = intval($_REQUEST["AccountId"]);
         // проверка введенного значения суммы оплаты
         $subtotal_P = $_REQUEST['OutSum'];
         $subtotal_P = trim($subtotal_P);
         //убиарем лишние пробелы
         $subtotal_P = str_replace(',', '.', $subtotal_P);
         // заменяем запятые на точку
         $subtotal_P = floatval($subtotal_P);
         // пробуем преобразовать к числу
         $subtotal_P = round($subtotal_P, 2);
         // округляем до 2 знаков после запятой
         if ($subtotal_P != 0 && $subtotal_P >= 10 && $subtotal_P < 10000) {
             $client_ip = $_SERVER["REMOTE_ADDR"];
             echo $client_ip . '<br \\>' . "\n";
             $order_IDP = Uniteller::NewOrder($accountId, $subtotal_P, $client_ip);
             echo $order_IDP . '<br \\>' . "\n";
             //// Для отладки разрешаем переход на страницу оплаты только с определённого IP
             //if ((strpos($client_ip, '10.79.124.') == 0)
             //    or (strpos($client_ip, '10.78.252.') == 0)) {
             Uniteller::GoToPaymentPage($accountId, $order_IDP, $subtotal_P);
             //}
         } else {
             // при некорректно введенной сумме платежа возвращаемся на эту же страницу
             $url_return = $_SERVER['HTTP_REFERER'];
             header('Location: ' . $url_return);
         }
         exit;
     }
 }
Example #16
0
 /**
  * Initialize the request
  */
 protected function init($command = '', $args = array())
 {
     parent::init();
     $this->setArgs($args);
     $this->setCommand($command);
 }
Example #17
0
 function init()
 {
     parent::init();
     config::set(array('robox_on' => true, 'robox_login' => '123567', 'robox_pass1' => 'xxxcccvvv', 'robox_pass2' => 'xxccvvbbnn', 'webmoney_on' => false, 'rbkmoney_on' => false, 'zpay_on' => false), false, 'ps_');
 }
Example #18
0
 protected function init($page = '', $args = array())
 {
     //Don't call parent if we don't have a page. This is a work around.
     if ($page) {
         parent::init();
     }
     $this->moduleName = $this->getModuleVar('title', 'module');
     $this->setArgs($args);
     $this->pagetype = $this->getPagetype();
     $this->platform = $this->getPlatform();
     $this->supportsCerts = $this->getSupportsCerts();
     switch ($this->getPagetype()) {
         case 'compliant':
             $this->imageExt = '.png';
             break;
         case 'touch':
         case 'basic':
             $this->imageExt = '.gif';
             break;
     }
     if ($page) {
         // Pull in fontsize
         if (isset($args['font'])) {
             $this->fontsize = $args['font'];
             setcookie('fontsize', $this->fontsize, time() + Kurogo::getSiteVar('LAYOUT_COOKIE_LIFESPAN'), COOKIE_PATH);
         } else {
             if (isset($_COOKIE['fontsize'])) {
                 $this->fontsize = $_COOKIE['fontsize'];
             }
         }
         $this->setPage($page);
         $this->setTemplatePage($this->page, $this->id);
         $this->setAutoPhoneNumberDetection(Kurogo::getSiteVar('AUTODETECT_PHONE_NUMBERS'));
     }
 }
Example #19
0
 public function init()
 {
     parent::init();
     $this->params['foo'] = 'bar';
     \Yii::configure($this, require __DIR__ . '/config.php');
 }
 function init($request)
 {
     parent::init($request);
     $this->tpl->caching = 0;
 }
 protected function init($page = '', $args = array())
 {
     $this->setArgs($args);
     //Don't call parent if we don't have a page. This is a work around.
     if ($page) {
         $this->setPage($page);
         parent::init();
     }
     $this->moduleName = $this->getModuleVar('title', 'module');
     $this->pagetype = $this->getPagetype();
     $this->platform = $this->getPlatform();
     $this->browser = $this->getBrowser();
     switch ($this->getPagetype()) {
         case 'compliant':
             $this->imageExt = '.png';
             break;
         case 'touch':
         case 'basic':
             $this->imageExt = '.gif';
             break;
     }
     $this->ajaxContentLoad = $this->getArg(self::AJAX_PARAMETER) ? true : false;
     $this->ajaxContainerPage = $this->getArg(self::AJAX_BREADCRUMB_CONTAINER_PAGE, $this->page);
     $this->ajaxContainerPageArgs = $this->getArg(self::AJAX_BREADCRUMB_CONTAINER_PAGE_ARGS, http_build_query($this->args));
     if ($page) {
         // Pull in fontsize
         if (isset($args['font'])) {
             $this->fontsize = $args['font'];
             setcookie('fontsize', $this->fontsize, time() + Kurogo::getSiteVar('LAYOUT_COOKIE_LIFESPAN'), COOKIE_PATH);
         } else {
             if (isset($_COOKIE['fontsize'])) {
                 $this->fontsize = $_COOKIE['fontsize'];
             }
         }
         $this->setTemplatePage($this->page, $this->id);
         $this->setAutoPhoneNumberDetection(Kurogo::getSiteVar('AUTODETECT_PHONE_NUMBERS'));
     }
 }
Example #22
0
 public function init()
 {
     $this->setImport(array('application.modules.' . $this->getName() . '.models.paymentsystems.*'));
     parent::init();
 }
Example #23
0
 /**
  * Initialize the request
  */
 protected function init($command = '', $args = array())
 {
     parent::init();
     $this->setArgs($args);
     $this->setRequestedVersion($this->getArg('v', null), $this->getArg('vmin', null));
     if ($context = $this->getArg('context', null)) {
         $this->setContext($context);
     }
     $this->setCommand($command);
 }
Example #24
0
 public function init()
 {
     Yii::import('application.modules.guestad.models.*');
     parent::init();
 }
Example #25
0
 function init()
 {
     Yii::import('application.modules.booking.models.TimesIn');
     parent::init();
 }
Example #26
0
 /**
  * Initialize the request
  */
 protected function init($command = '', $args = array())
 {
     set_error_handler(array($this, 'warningHandler'), E_WARNING | E_NOTICE | E_STRICT);
     $this->setArgs($args);
     $this->setRequestedVersion($this->getArg('v', null), $this->getArg('vmin', null));
     $this->setClientVersion($this->getArg('clientv', null));
     $this->setClient($this->getArg('client'));
     if ($context = $this->getArg('context', null)) {
         $this->setContext($context);
     }
     $this->setCommand($command);
     parent::init();
 }