Esempio n. 1
0
 public function setAuthToken($user_id, $auth_token, $type = null, $subj = null)
 {
     if (!$type) {
         $type = cmsRequest::getDeviceType();
     }
     return $this->insert('{users}_auth_tokens', array('ip' => sprintf('%u', ip2long(cmsUser::getIp())), 'access_type' => cmsModel::arrayToYaml(array('type' => $type, 'subj' => $subj)), 'auth_token' => $auth_token, 'user_id' => $user_id));
 }
Esempio n. 2
0
 /**
  * Выводит окончательный вид страницы в браузер
  */
 public function renderPage()
 {
     $config = $this->site_config;
     $layout = $this->getLayout();
     $template_file = $this->getTplFilePath($layout . '.tpl.php');
     $device_type = cmsRequest::getDeviceType();
     if ($template_file) {
         if (!$config->min_html) {
             include $template_file;
         }
         if ($config->min_html) {
             ob_start();
             include $template_file;
             echo html_minify(ob_get_clean());
         }
     } else {
         cmsCore::error(ERR_TEMPLATE_NOT_FOUND . ': ' . $this->name . ':' . $layout);
     }
 }