当前位置: 首页>>代码示例>>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;未经允许,请勿转载。