當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Token::isExist方法代碼示例

本文整理匯總了PHP中Token::isExist方法的典型用法代碼示例。如果您正苦於以下問題:PHP Token::isExist方法的具體用法?PHP Token::isExist怎麽用?PHP Token::isExist使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Token的用法示例。


在下文中一共展示了Token::isExist方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

/**
* GeniXCMS - Content Management System
* 
* PHP Based Content Management System and Framework
*
* @package GeniXCMS
* @since 0.0.1 build date 20150202
* @version 0.0.6
* @link https://github.com/semplon/GeniXCMS
* @link http://genixcms.org
* @author Puguh Wijayanto (www.metalgenix.com)
* @copyright 2014-2015 Puguh Wijayanto
* @license http://www.opensource.org/licenses/mit-license.php MIT
*
*/
if (isset($_GET['token']) && Token::isExist($_GET['token'])) {
    $token = TOKEN;
} else {
    $token = '';
}
$_GET['act'] == "edit" ? $pagetitle = "Edit" : ($pagetitle = "New");
$_GET['act'] == "edit" ? $act = "edit&id={$_GET['id']}&token={$_GET['token']}" : ($act = "add");
if (isset($data['alertgreen'])) {
    # code...
    echo "<div class=\"alert alert-success\" >\n    <button type=\"button\" class=\"close\" data-dismiss=\"alert\">\n        <span aria-hidden=\"true\">&times;</span>\n        <span class=\"sr-only\">Close</span>\n    </button>";
    foreach ($data['alertgreen'] as $alert) {
        # code...
        echo "{$alert}\n";
    }
    echo "</div>";
}
開發者ID:vdanelia,項目名稱:GeniXCMS,代碼行數:31,代碼來源:posts_form.php

示例2: define

*
*/
define('GX_PATH', realpath(__DIR__ . '/'));
define('GX_LIB', GX_PATH . '/inc/lib/');
define('GX_MOD', GX_PATH . '/inc/mod/');
define('GX_THEME', GX_PATH . '/inc/themes/');
define('GX_ASSET', GX_PATH . '/assets/');
require "autoload.php";
try {
    new System();
} catch (Exception $e) {
    echo $e->getMessage();
}
if (isset($_POST['forgotpass'])) {
    // Check token first
    if (isset($_POST['token']) && Token::isExist($_POST['token'])) {
        /*check if username is exist or not */
        $username = Typo::cleanX(Typo::strip($_POST['username']));
        $sql = sprintf("SELECT `userid`,`email`,`status`,`activation` FROM `user` WHERE `userid` = '%s'", $username);
        $usr = Db::result($sql);
        $c = Db::$num_rows;
        //echo $c;
        //print_r($usr);
        if ($c == "1") {
            //$alertgreen = "";
            // check if user is active
            if ($usr[0]->status == '1') {
                /* get user password */
                $newpass = User::generatePass();
                $id = User::id($username);
                $pass = User::randpass($newpass);
開發者ID:vdanelia,項目名稱:GeniXCMS,代碼行數:31,代碼來源:forgotpassword.php

示例3: array

* @link https://github.com/semplon/GeniXCMS
* @link http://genixcms.org
* @author Puguh Wijayanto (www.metalgenix.com)
* @copyright 2014-2015 Puguh Wijayanto
* @license http://www.opensource.org/licenses/mit-license.php MIT
*
*/
$data['sitetitle'] = MODULES;
if (isset($GLOBALS['alertred'])) {
    $data['alertred'] = $GLOBALS['alertred'];
}
if (isset($GLOBALS['alertgreen'])) {
    $data['alertgreen'][] = $GLOBALS['alertgreen'];
}
if (isset($_POST['upload'])) {
    if (!Token::isExist($_POST['token'])) {
        $alertred[] = TOKEN_NOT_EXIST;
    }
    if (!isset($_FILES['module']['name']) || $_FILES['module']['name'] == "") {
        $alertred[] = NOFILE_UPLOADED;
    }
    if (!isset($alertred)) {
        //Mod::activate($_GET['modules']);
        $path = "/inc/mod/";
        $allowed = array('zip');
        $mod = Upload::go('module', $path, $allowed);
        //print_r($mod);
        $zip = new ZipArchive();
        if ($zip->open($mod['filepath']) === TRUE) {
            $zip->extractTo(GX_MOD);
            $zip->close();
開發者ID:vdanelia,項目名稱:GeniXCMS,代碼行數:31,代碼來源:modules.control.php

示例4: foreach

     }
     if (isset($alertred)) {
         $data['alertred'] = $alertred;
     } else {
         foreach ($post_id as $id) {
             # code...
             Posts::unpublish($id);
         }
     }
     if (isset($_POST['token'])) {
         Token::remove($_POST['token']);
     }
     break;
 case 'delete':
     # code...
     if (!isset($_POST['token']) || !Token::isExist($_POST['token'])) {
         // VALIDATE ALL
         $alertred[] = TOKEN_NOT_EXIST;
     }
     if (isset($alertred)) {
         $data['alertred'] = $alertred;
     } else {
         foreach ($post_id as $id) {
             # code...
             Posts::delete($id);
         }
     }
     if (isset($_POST['token'])) {
         Token::remove($_POST['token']);
     }
     break;
開發者ID:vdanelia,項目名稱:GeniXCMS,代碼行數:31,代碼來源:pages.control.php

示例5: loader

 public static function loader()
 {
     $data = "";
     if (isset($_GET['page']) && $_GET['page'] == "modules") {
         if (isset($_GET['act'])) {
             if ($_GET['act'] == ACTIVATE) {
                 if (!Token::isExist($_GET['token'])) {
                     $alertred[] = TOKEN_NOT_EXIST;
                 }
                 if (!isset($alertred)) {
                     self::activate($_GET['modules']);
                     $GLOBALS['alertgreen'] = MODULES_ACTIVATED;
                 } else {
                     $GLOBALS['alertred'] = $alertred;
                 }
             } elseif ($_GET['act'] == DEACTIVATE) {
                 if (!Token::isExist($_GET['token'])) {
                     $alertred[] = TOKEN_NOT_EXIST;
                 }
                 if (!isset($alertred)) {
                     self::deactivate($_GET['modules']);
                     $GLOBALS['alertgreen'] = MODULES_DEACTIVATED;
                 } else {
                     $GLOBALS['alertred'] = $alertred;
                 }
             } elseif ($_GET['act'] == 'remove') {
                 if (!Token::isExist($_GET['token'])) {
                     $alertred[] = TOKEN_NOT_EXIST;
                 }
                 if (Mod::isActive($_GET['modules'])) {
                     $alertred[] = "Module is Active. Please deactivate first.";
                 }
                 if (!isset($alertred)) {
                     self::deactivate($_GET['modules']);
                     Files::delTree(GX_MOD . "/" . $_GET['modules']);
                     $GLOBALS['alertgreen'] = MODULES_DELETED;
                 } else {
                     $GLOBALS['alertred'] = $alertred;
                 }
             }
         }
     }
     $json = Options::get('modules');
     $mods = json_decode($json, true);
     if (!is_array($mods) || $mods == "") {
         $mods = array();
     }
     foreach ($mods as $m) {
         if (self::exist($m)) {
             self::load($m);
         }
     }
     return $data;
 }
開發者ID:vdanelia,項目名稱:GeniXCMS,代碼行數:54,代碼來源:Mod.class.php

示例6: elseif

         Token::remove($_POST['token']);
     }
 }
 if (isset($_GET['act'])) {
     if ($_GET['act'] == 'activate') {
         if (!Token::isExist($_GET['token'])) {
             $alertred[] = TOKEN_NOT_EXIST;
         }
         if (!isset($alertred)) {
             Theme::activate($_GET['themes']);
             $data['alertgreen'][] = THEME_ACTIVATED;
         } else {
             $data['alertred'] = $alertred;
         }
     } elseif ($_GET['act'] == 'remove') {
         if (!Token::isExist($_GET['token'])) {
             $alertred[] = TOKEN_NOT_EXIST;
         }
         if (Theme::isActive($_GET['themes'])) {
             $alertred[] = MSG_THEME_IS_ACTIVE;
         }
         if (!isset($alertred)) {
             if (Files::delTree(GX_THEME . "/" . $_GET['themes'])) {
                 $data['alertgreen'][] = THEME_REMOVED;
             } else {
                 $data['alertred'][] = MSG_THEME_NOT_REMOVED;
             }
         } else {
             $data['alertred'] = $alertred;
         }
     }
開發者ID:vdanelia,項目名稱:GeniXCMS,代碼行數:31,代碼來源:themes.control.php


注:本文中的Token::isExist方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。