public static function allowOnlyRefer($inputData)
 {
     $refer = Http::get('refer');
     $inputData = str_replace('/', '\\/', $inputData);
     if (!preg_match('/' . $inputData . '/i', $refer)) {
         Alert::make('Page not found');
     }
 }
 public static function makeWithPath($viewName, $inputData, $themePath)
 {
     $filepath = $themePath . $viewName . '.php';
     if (!file_exists($filepath)) {
         Alert::make('View ' . $viewName . ' not exists.');
     }
     // $data=file_get_contents($themePath.$viewName);
     $data = self::parseData($filepath);
     extract($inputData);
     include $data;
 }
 public function index()
 {
     System::systemStatus();
     // if($match=Uri::match('^(\w+)$'))
     // {
     // 	echo $match[1];
     // }
     $themePath = System::getThemePath();
     $indexPath = $themePath . 'index.php';
     if (file_exists($indexPath)) {
         Theme::checkDomain();
         Theme::checkThemePrefix();
         Theme::loadShortCode();
         include $indexPath;
     } else {
         Alert::make('Theme not found');
     }
 }
 public function index()
 {
     $controlName = 'admincp/controlDashboard';
     if (Cookie::has('userid')) {
         $valid = UserGroups::getPermission(Users::getCookieGroupId(), 'can_view_admincp');
         if ($valid != 'yes') {
             Alert::make('You not have permission to view this page');
         }
         $controlName = 'admincp/controlDashboard';
         $default_adminpage_method = trim(System::getSetting('default_adminpage_method', 'none'));
         if ($default_adminpage_method == 'url') {
             $default_adminpage = trim(System::getSetting('default_adminpage_url', 'admincp/'));
             if ($default_adminpage != 'admincp/' && System::getUri() == 'admincp/') {
                 $beginUri = 'admincp';
                 if ($default_adminpage[0] != '/') {
                     $beginUri .= '/';
                 }
                 System::setUri($beginUri . $default_adminpage);
             }
         }
         if ($match = Uri::match('^admincp\\/(\\w+)')) {
             $controlName = 'admincp/control' . ucfirst($match[1]);
         }
     } else {
         $controlName = 'admincp/controlLogin';
         if ($match = Uri::match('^admincp\\/forgotpass')) {
             $controlName = 'admincp/controlForgotpass';
         }
     }
     $codeHead = Plugins::load('admincp_header');
     $codeHead = is_array($codeHead) ? '' : $codeHead;
     $codeFooter = Plugins::load('admincp_footer');
     $codeFooter = is_array($codeFooter) ? '' : $codeFooter;
     // print_r($codeHead);die();
     System::defineGlobalVar('admincp_header', $codeHead);
     System::defineGlobalVar('admincp_footer', $codeFooter);
     Controller::load($controlName);
 }
Beispiel #5
0
<?php

if ((int) GlobalCMS::$setting['enable_rss'] == 0) {
    Alert::make('Page not found');
}
$pageName = 'rss';
$pageData = array();
$headData = GlobalCMS::$setting;
Theme::model('rss');
$pageData['listPost'] = listRss();
$pageData['setting'] = $headData;
Theme::view($pageName, $pageData);
 public function controller()
 {
     $post = array();
     if ($matchCtr = Uri::match('\\/setting\\/(\\w+)\\/controller\\/(\\w+)')) {
         $controllerName = $matchCtr[2];
         $themeName = $matchCtr[1];
         $path = THEMES_PATH . $themeName . '/cp/controller/control' . ucfirst($controllerName) . '.php';
         if (!file_exists($path)) {
             Alert::make('Controller <b>' . $controllerName . '</b> of theme ' . $themeName . ' not found.');
         }
         define("THEME_CP_PATH", THEMES_PATH . $themeName . 'cp/');
         $post['file'] = $path;
         $post['themename'] = $themeName;
         View::make('admincp/head', array('title' => 'Setting theme ' . $themeName . ' - ' . ADMINCP_TITLE));
         self::makeContents('themeControl', $post);
         View::make('admincp/footer');
     }
 }
Beispiel #7
0
 public static function onlyWord()
 {
     global $cmsUri;
     //        echo $cmsUri;
     //        die();
     if (preg_match('/[\\<\\>\\$]/i', $cmsUri)) {
         Alert::make('Page not found');
     }
 }