当前位置: 首页>>代码示例>>PHP>>正文


PHP verifyToken函数代码示例

本文整理汇总了PHP中verifyToken函数的典型用法代码示例。如果您正苦于以下问题:PHP verifyToken函数的具体用法?PHP verifyToken怎么用?PHP verifyToken使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了verifyToken函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     parent::__construct();
     $privSet = verifyToken();
     if (!$privSet) {
         $this->response(array('error' => 'Invalid or missing token.'), 401);
     }
     $this->load->model('statemodel');
 }
开发者ID:Ayeblinken,项目名称:potonka,代码行数:9,代码来源:statecontroller.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     if (!verifyToken()) {
         $this->response(array('error' => 'Invalid or missing token.'), 401);
     }
     date_default_timezone_set('America/Indianapolis');
     $this->load->model('uploadfilesmodel');
 }
开发者ID:Ayeblinken,项目名称:potonka,代码行数:9,代码来源:uploadfiles_api.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     $privSet = verifyToken();
     if (!$privSet) {
         $this->response(array('error' => 'Invalid or missing token.'), 401);
     }
     $this->load->model('statuslogmodel');
     $this->load->library('user_agent');
     date_default_timezone_set('America/Indianapolis');
 }
开发者ID:Ayeblinken,项目名称:potonka,代码行数:11,代码来源:statuslogcontroller.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     $privSet = verifyToken();
     if (!$privSet) {
         $this->response(array('error' => 'Invalid or missing token.'), 401);
     }
     if (!checkPermissionsByModule($privSet, 'vendor')) {
         $this->response(array('error' => 'You\'re privilege set doesn\'t allow access to this content'), 400);
     }
     $this->load->model('vendormodel');
 }
开发者ID:Ayeblinken,项目名称:potonka,代码行数:12,代码来源:vendor_api.php

示例5: __construct

 public function __construct()
 {
     parent::__construct();
     $privSet = verifyToken();
     if (!$privSet) {
         $this->response(array('error' => 'Invalid or missing token.'), 401);
     }
     if (!checkPermissionsByModule($privSet, 'inventory')) {
         $this->response(array('error' => 'You\'re privilege set doesn\'t allow access to this content'), 400);
     }
     date_default_timezone_set('America/Indianapolis');
     $this->load->model('inventoryitemstobuilditemslinkmodel');
 }
开发者ID:Ayeblinken,项目名称:potonka,代码行数:13,代码来源:inventoryitemstobuilditemslink_api.php

示例6: __construct

 public function __construct()
 {
     parent::__construct();
     $privSet = verifyToken();
     if (!$privSet) {
         $this->response(array('error' => 'Invalid or missing token.'), 401);
     }
     if (!checkPermissionsByModule($privSet, 'inventory')) {
         $this->response(array('error' => 'You\'re privilege set doesn\'t allow access to this content'), 400);
     }
     date_default_timezone_set('America/Indianapolis');
     $this->load->model('inventoryitemmodel');
     $this->load->helper('download');
     $this->load->helper('file');
     $this->orderRedoUploadPath = realpath(APPPATH . '../../../images/');
 }
开发者ID:Ayeblinken,项目名称:potonka,代码行数:16,代码来源:inventoryitem_api.php

示例7: elseif

<?php

if ($params[1] == 'save') {
    if (verifyToken('canned', $input->p['csrfhash']) !== true) {
        $error_msg = $LANG['CSRF_ERROR'];
    } elseif ($input->p['title'] == '') {
        $error_msg = $LANG['ENTER_THE_TITLE'];
    } else {
        $total = $db->fetchOne("SELECT COUNT(id) AS NUM FROM " . TABLE_PREFIX . "canned_response");
        $data = array('title' => $input->p['title'], 'message' => $input->p['message'], 'position' => $total + 1);
        $db->insert(TABLE_PREFIX . "canned_response", $data);
        header('location: ' . getUrl($controller, $action, array('canned', 'saved')));
        exit;
    }
} elseif ($params[1] == 'editMsg') {
    if (verifyToken('canned', $input->p['csrfhash']) !== true) {
        $error_msg = $LANG['CSRF_ERROR'];
    } elseif ($input->p['title'] == '') {
        $error_msg = $LANG['ENTER_THE_TITLE'];
    } elseif (!is_numeric($input->p['msgid'])) {
        $error_msg = $LANG['INVALID_ID'];
    } else {
        $data = array('title' => $input->p['title'], 'message' => $input->p['message']);
        $db->update(TABLE_PREFIX . "canned_response", $data, "id=" . $db->real_escape_string($input->p['msgid']));
        header('location: ' . getUrl($controller, $action, array('canned', 'updated')));
        exit;
    }
} elseif ($params[1] == 'GetCannedForm') {
    if (is_numeric($params[2]) && $params[2] != 0) {
        $canned = $db->fetchRow("SELECT *, COUNT(id) as total FROM " . TABLE_PREFIX . "canned_response WHERE id=" . $db->real_escape_string($params[2]));
        if ($canned['total'] == 0) {
开发者ID:anteknik,项目名称:helpdesk,代码行数:31,代码来源:tickets_canned.php

示例8: rest_delete

 public function rest_delete($tableName, $id)
 {
     if (!empty($tableName)) {
         $result = $this->restmodel->getPrimaryKeyFieldName($tableName);
     }
     $privSet = verifyToken();
     if (!checkPermissionsByTable($privSet, $tableName)) {
         $this->response(array('error' => 'You\'re privilege set doesn\'t allow access to this content'), 400);
     }
     // we want to get the key name from an array
     if ($result) {
         $primaryKeyName = $result['COLUMN_NAME'];
         if (!empty($id)) {
             //echo $tableName."<br/>".$primaryKeyName."<br/>".$id;
             $this->restmodel->deleteTblData($tableName, $primaryKeyName, $id);
         }
     } else {
         $this->response(array('mssg' => 'no primary key field name detected'), 404);
         // 200 being the HTTP response code
     }
     //$this->restmodel->deleteTblData($tableName,$keyName,$id);
     $this->response(array('returned from delete:' => $id));
 }
开发者ID:Ayeblinken,项目名称:potonka,代码行数:23,代码来源:rest_api.php

示例9: array

<?php

if ($params[0] == 'save') {
    if (verifyToken('preferences', $input->p['csrfhash']) !== true) {
        $error_msg = $LANG['CSRF_ERROR'];
    } else {
        $timezone_user = '';
        if (!empty($input->p['timezone'])) {
            if (in_array($input->p['timezone'], $timezone)) {
                $timezone_user = $input->p['timezone'];
            }
        }
        $data = array('timezone' => $timezone_user);
        $db->update(TABLE_PREFIX . "users", $data, "id={$user['id']}");
        header('location: ' . getUrl('user_account', 'preferences', array('saved')));
        exit;
    }
}
$template_vars['timezone'] = $timezone;
$template_vars['user'] = $user;
$template_vars['error_msg'] = $error_msg;
$template = $twig->loadTemplate('user_preferences.html');
echo $template->render($template_vars);
$db->close();
exit;
开发者ID:anteknik,项目名称:helpdesk,代码行数:25,代码来源:preferences_action.php

示例10: alert

<?php

require MODELES . 'membres/token.php';
if (verifyToken($_GET['token'])) {
    if (connected()) {
        alert('ok', 'Votre nouvelle adresse mail a été validée ! Vous pouvez désormais l\'utiliser.');
        header('Location: ' . getLink(['membres', 'profil']));
        exit;
    } else {
        alert('ok', 'Votre adresse mail a été validée ! Vous pouvez désormais vous connecter.');
        header('Location: ' . getLink(['membres', 'connexion']));
        exit;
    }
} else {
    alert('error', 'Une erreur s\'est produite. Si vous êtes un méchant hacker, sachez que ce que vous étiez en train d\'essayer de faire ne va pas fonctionner.');
    header('Location: ' . getLink(['accueil']));
    exit;
}
开发者ID:aurelienshz,项目名称:g1a,代码行数:18,代码来源:confirm.php

示例11: elseif

        }
        $news_title = $input->p['title'] == '' ? $news['title'] : $input->p['title'];
        $news_content = $input->p['content'] == '' ? $news['content'] : $input->p['content'];
        $template_vars['news'] = $news;
        $template_vars['news_id'] = $news_id;
        $template_vars['news_title'] = $news_title;
        $template_vars['news_content'] = $news_content;
        $template_vars['error_msg'] = $error_msg;
        $template = $twig->loadTemplate('news_edit.html');
        echo $template->render($template_vars);
        $db->close();
        exit;
    }
}
if ($input->p['do'] == 'update') {
    if (verifyToken('news', $input->p['csrfhash']) !== true) {
        $error_msg = $LANG['CSRF_ERROR'];
    } elseif (!is_array($input->p['news_id'])) {
        $error_msg = $LANG['NO_SELECT_TICKET'];
    } else {
        foreach ($input->p['news_id'] as $k) {
            if (is_numeric($k)) {
                $news_id = $db->real_escape_string($k);
                if ($input->p['remove'] == 1) {
                    $db->delete(TABLE_PREFIX . "news", "id='{$news_id}'");
                }
            }
        }
        header('location: ' . getUrl($controller, $action, array('page', $page, $orderby, $sortby), $getvar));
        exit;
    }
开发者ID:anteknik,项目名称:helpdesk,代码行数:31,代码来源:news_manage.php

示例12: time

                    $cookie_time = time() + 60 * 60 * 8;
                    $data = array('id' => $staff['id'], 'username' => $staff['username'], 'password' => $password, 'expires' => $cookie_time);
                    $data = serialize($data);
                    $data = encrypt($data);
                    setcookie('stfhash', $data, $cookie_time, '/');
                    $_SESSION['staff']['id'] = $staff['id'];
                    $_SESSION['staff']['username'] = $staff['username'];
                    $_SESSION['staff']['password'] = $password;
                }
                header('location:' . getUrl($controller, $action, array('staff', 'account_updated')));
                exit;
            }
        }
    }
} elseif ($params[1] == 'add_account') {
    if (verifyToken('staff_account', $input->p['csrfhash']) !== true) {
        $error_msg = $LANG['CSRF_ERROR'];
    } elseif ($input->p['fullname'] == '' || $input->p['username'] == '' || $input->p['email'] == '' || $input->p['password'] == '') {
        $error_msg = $LANG['ONE_REQUIRED_FIELDS_EMPTY'];
    } elseif (validateEmail($input->p['email']) !== TRUE) {
        $error_msg = $LANG['ENTER_A_VALID_EMAIL'];
    } elseif ($input->p['password'] != $input->p['password2']) {
        $error_msg = $LANG['PASSWORDS_DONOT_MATCH'];
    } elseif (strlen($input->p['password']) < 6) {
        $error_msg = $LANG['ENTER_PASSWORD_6_CHAR_MIN'];
    } else {
        $chk = $db->fetchOne("SELECT COUNT(id) AS total FROM " . TABLE_PREFIX . "staff WHERE username='" . $db->real_escape_string($input->p['username']) . "'");
        if ($chk != 0) {
            $error_msg = $LANG['USERNAME_TAKEN'];
        }
        $chk = $db->fetchOne("SELECT COUNT(id) AS total FROM " . TABLE_PREFIX . "staff WHERE email='" . $db->real_escape_string($input->p['email']) . "'");
开发者ID:anteknik,项目名称:helpdesk,代码行数:31,代码来源:staff_action.php

示例13: verifyajax

    $gateway[$n] = $row;
    $n = $n + 1;
}
if ($input->p['a'] == "submit") {
    verifyajax();
    $username = $input->pc['username'];
    $password = $input->pc['password'];
    $password2 = $input->pc['password2'];
    $fullname = $input->pc['fullname'];
    $email = $input->pc['email'];
    $email2 = $input->pc['email2'];
    $captcha = strtoupper($input->pc['captcha']);
    $terms = $input->pc['terms'];
    $referrer = $db->real_escape_string($_SESSION['ref']);
    $gatewayid = $input->p['gatewayid'];
    if (verifyToken("register", $input->p['token']) !== true) {
        serveranswer(0, $lang['txt']['invalidtoken']);
    }
    if ($settings['captcha_register'] == "yes") {
        if ($settings['captcha_type'] == "1") {
            $resp = validate_captcha($captcha, "");
        } else {
            if ($settings['captcha_type'] == "2") {
                $resp = validate_captcha($_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field']);
            } else {
                if ($settings['captcha_type'] == "3") {
                    $resp = validate_captcha();
                }
            }
        }
    }
开发者ID:erikhu,项目名称:referal_constant,代码行数:31,代码来源:register.php

示例14: array

if ($params[1] == 'update_general') {
    if (verifyToken('ticket_settings', $input->p['csrfhash']) !== true) {
        $error_msg = $LANG['CSRF_ERROR'];
    } else {
        $db->update(TABLE_PREFIX . "settings", array('value' => $input->p['show_tickets'] == 'DESC' ? 'DESC' : 'ASC'), "field='show_tickets'");
        $db->update(TABLE_PREFIX . "settings", array('value' => $input->p['ticket_reopen'] == '1' ? '1' : '0'), "field='ticket_reopen'");
        $db->update(TABLE_PREFIX . "settings", array('value' => is_numeric($input->p['tickets_page']) ? $input->p['tickets_page'] : 20), "field='tickets_page'");
        $db->update(TABLE_PREFIX . "settings", array('value' => is_numeric($input->p['tickets_replies']) ? $input->p['tickets_replies'] : 10), "field='tickets_replies'");
        $db->update(TABLE_PREFIX . "settings", array('value' => is_numeric($input->p['overdue_time']) ? $input->p['overdue_time'] : 72), "field='overdue_time'");
        $db->update(TABLE_PREFIX . "settings", array('value' => is_numeric($input->p['closeticket_time']) ? $input->p['closeticket_time'] : 72), "field='closeticket_time'");
        $db->update(TABLE_PREFIX . "settings", array('value' => $input->p['ticket_attachment'] == '1' ? '1' : '0'), "field='ticket_attachment'");
        header('location: ' . getUrl($controller, $action, array('tickets', 'general_updated#ctab1')));
        exit;
    }
} elseif ($params[1] == 'delete_filetype') {
    if (verifyToken('ticket_settings', $input->p['csrfhash']) !== true) {
        $error_msg = $LANG['CSRF_ERROR'];
    } elseif (!is_array($input->p['filetype_id'])) {
        $error_msg = $LANG['INVALID_FORM'];
    } else {
        if ($input->p['remove'] == 1) {
            foreach ($input->p['filetype_id'] as $id) {
                $db->delete(TABLE_PREFIX . "file_types", "id='" . $db->real_escape_string($id) . "'");
            }
            header('location: ' . getUrl($controller, $action, array('tickets', 'filetype_removed#ctab2')));
            exit;
        }
    }
} elseif ($params[1] == 'insert_filetype') {
    if ($input->p['do'] != 'insert') {
        $error_msg = $LANG['INVALID_FORM'];
开发者ID:rb2,项目名称:HelpDeskZ-1.0,代码行数:31,代码来源:tickets_action.php

示例15: elseif

        exit;
    }
} elseif ($params[1] == 'update_security') {
    if (verifyToken('general_settings', $input->p['csrfhash']) !== true) {
        $error_msg = $LANG['CSRF_ERROR'];
    } else {
        $db->update(TABLE_PREFIX . "settings", array('value' => $input->p['use_captcha'] == 1 ? 1 : 0), "field='use_captcha'");
        $db->update(TABLE_PREFIX . "settings", array('value' => is_numeric($input->p['login_attempt']) ? $input->p['login_attempt'] : 3), "field='login_attempt'");
        $db->update(TABLE_PREFIX . "settings", array('value' => is_numeric($input->p['login_attempt_minutes']) ? $input->p['login_attempt_minutes'] : 5), "field='login_attempt_minutes'");
        $db->update(TABLE_PREFIX . "settings", array('value' => $input->p['loginshare'] == 1 ? 1 : 0), "field='loginshare'");
        $db->update(TABLE_PREFIX . "settings", array('value' => $input->p['loginshare_url']), "field='loginshare_url'");
        header('location: ' . getUrl($controller, $action, array('general', 'security_updated#ctab6')));
        exit;
    }
} elseif ($params[1] == 'update_social') {
    if (verifyToken('general_settings', $input->p['csrfhash']) !== true) {
        $error_msg = $LANG['CSRF_ERROR'];
    } else {
        $db->update(TABLE_PREFIX . "settings", array('value' => $input->p['facebookoauth'] == 1 ? 1 : 0), "field='facebookoauth'");
        $db->update(TABLE_PREFIX . "settings", array('value' => $input->p['facebookappid']), "field='facebookappid'");
        $db->update(TABLE_PREFIX . "settings", array('value' => $input->p['facebookappsecret']), "field='facebookappsecret'");
        $db->update(TABLE_PREFIX . "settings", array('value' => $input->p['googleoauth'] == 1 ? 1 : 0), "field='googleoauth'");
        $db->update(TABLE_PREFIX . "settings", array('value' => $input->p['googleclientid']), "field='googleclientid'");
        $db->update(TABLE_PREFIX . "settings", array('value' => $input->p['googleclientsecret']), "field='googleclientsecret'");
        $db->update(TABLE_PREFIX . "settings", array('value' => $input->p['socialbuttonnews']), "field='socialbuttonnews'");
        $db->update(TABLE_PREFIX . "settings", array('value' => $input->p['socialbuttonkb']), "field='socialbuttonkb'");
        header('location: ' . getUrl($controller, $action, array('general', 'security_social#ctab7')));
        exit;
    }
}
$homepage = $db->fetchRow("SELECT * FROM " . TABLE_PREFIX . "pages WHERE id='home'");
开发者ID:smart-home-technology,项目名称:HelpDeskZ-1.0,代码行数:31,代码来源:general_action.php


注:本文中的verifyToken函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。