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


PHP Password::removeToken方法代码示例

本文整理汇总了PHP中Password::removeToken方法的典型用法代码示例。如果您正苦于以下问题:PHP Password::removeToken方法的具体用法?PHP Password::removeToken怎么用?PHP Password::removeToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Password的用法示例。


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

示例1: token

function token()
{
    global $instDir, $objMessages, $entryMessage;
    // Get the userid
    include_once $instDir . "lib/password.php";
    $password = new Password();
    $token = $_GET['t'];
    $userid = $password->getUserId($token);
    if (sizeof($userid) > 0) {
        // Clear the request
        $password->removeToken($token);
        // Send a mail that the request was canceled.
        if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
            $ip = $_SERVER['HTTP_CLIENT_IP'];
        } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
        } else {
            $ip = $_SERVER['REMOTE_ADDR'];
        }
        $subject = LangCancelRequestNewPasswordSubject;
        $message = LangCancelRequestNewPassword1 . $ip;
        $message .= LangCancelRequestNewPassword2;
        $objMessages->sendEmail($subject, $message, $userid);
        // Go to the DeepskyLog page and show 'Your password change request was canceled'
        $entryMessage = LangCancelRequestNewPasswordSubject . ".";
    }
}
开发者ID:rolfvandervleuten,项目名称:DeepskyLog,代码行数:27,代码来源:removeToken.php

示例2: token

function token()
{
    global $instDir, $objMessages, $entryMessage;
    // Get the userid
    include_once $instDir . "lib/password.php";
    $password = new Password();
    $token = $_GET['t'];
    if ($password->tokenExists($token)) {
        // Only go on when the token is not too old. If the token is too old, remove the token.
        if ($password->isValid($token)) {
            // Go to the correct
            echo "<div id=\"main\">";
            // TODO: Add form to change the password.
            // TODO: Add scripts to change the password.
            print "TEST: " . $userid;
            echo "</div>";
        } else {
            // TODO: Change
            print "<br/>TOKEN IS NOT VALID ANYMORE!";
        }
    } else {
        // TODO: Change message
        $entryMessage = "TOKEN DOES NOT EXIST!";
        $_GET['indexAction'] = 'main';
        // TODO: Return the index page
        return;
    }
    if (sizeof($userid) > 0) {
        // Clear the request
        $password->removeToken($token);
        // Send a mail that the request was canceled.
        if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
            $ip = $_SERVER['HTTP_CLIENT_IP'];
        } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
        } else {
            $ip = $_SERVER['REMOTE_ADDR'];
        }
        $subject = LangCancelRequestNewPasswordSubject;
        $message = LangCancelRequestNewPassword1 . $ip;
        $message .= LangCancelRequestNewPassword2;
        $objMessages->sendEmail($subject, $message, $userid);
        // Go to the DeepskyLog page and show 'Your password change request was canceled'
        $entryMessage = LangCancelRequestNewPasswordSubject . ".";
    }
}
开发者ID:rolfvandervleuten,项目名称:DeepskyLog,代码行数:46,代码来源:changeToken.php

示例3: instructions

function instructions()
{
    global $baseURL, $loggedUser, $myList, $lastReadObservation, $theDate, $modules, $menuView, $menuAddChange, $menuAdmin, $menuLogin, $menuSearch, $menuDownloads, $menuMoon, $listname_ss, $listname, $entryMessage, $step, $objSession, $objAccomplishments, $objEyepiece, $objFilter, $objLens, $objInstrument, $objLocation, $objMessages, $objObject, $objObserver, $objObservation, $objFormLayout, $objUtil, $objList;
    if ($objUtil->checkGetKey('saveLayout')) {
        $objFormLayout->saveLayout($objUtil->checkGetKey('formName', 'NoFormName'), $objUtil->checkGetKey('layoutName', 'layoutName'), $objUtil->checkGetKey('restoreColumns', ''), $objUtil->checkGetKey('orderColumns', ''));
    }
    if ($objUtil->checkGetKey('removeLayout')) {
        $objFormLayout->removeLayout($objUtil->checkGetKey('formName', 'NoFormName'), $objUtil->checkGetKey('layoutName', 'layoutName'));
    }
    if (($markAsRead = $objUtil->checkGetKey('markAsRead', 0)) === "All") {
        $objObserver->markAllAsRead();
    } elseif ($markAsRead) {
        $objObserver->markAsRead($markAsRead);
    }
    $theDate = date('Ymd', strtotime('-1 year'));
    if ($objUtil->checkGetKey('indexAction', 'x') == 'x' || $objUtil->checkGetKey('catalog', 'x') == '%' && $objUtil->checkGetKey('minyear', 'x') == substr($theDate, 0, 4) && $objUtil->checkGetKey('minmonth', 'x') == substr($theDate, 4, 2) && $objUtil->checkGetKey('minday', 'x') == substr($theDate, 6, 2) && ($objUtil->checkGetKey('sort', 'x') == 'x' || $objUtil->checkGetKey('sort', 'x') == 'observationid' && $objUtil->checkGetKey('sortdirection', 'x') == 'desc')) {
        $lastReadObservation = $loggedUser ? $objObserver->getLastReadObservation($loggedUser) : -1;
    } else {
        $lastReadObservation = -1;
    }
    if ($objUtil->checkGetKey('indexAction') == "removeToken") {
        require_once $instDir . "common/control/removeToken.php";
    }
    if ($objUtil->checkGetKey('indexAction') == "logout") {
        // logout
        require_once $instDir . "common/control/logout.php";
    }
    // listnames
    $myList = False;
    $listname = '';
    if (array_key_exists('listname', $_SESSION) && $_SESSION['listname'] != "----------") {
        $listname = $_SESSION['listname'];
    }
    $listname_ss = stripslashes($listname);
    if (array_key_exists('listname', $_SESSION) && $objList->checkList($_SESSION['listname']) == 2) {
        $myList = True;
    }
    // LCO for viewing observation lists in list, compact or last-own compact
    if (array_key_exists('lco', $_GET) && ($_GET['lco'] == "L" || $_GET['lco'] == "C" || $_GET['lco'] == "O")) {
        $cookietime = time() + 365 * 24 * 60 * 60;
        // 1 year
        $_SESSION['lco'] = $_GET['lco'];
        setcookie("lco", $_SESSION['lco'], $cookietime, "/");
    } elseif (array_key_exists('lco', $_COOKIE) && ($_COOKIE['lco'] == "L" || $_COOKIE['lco'] == "C" || $_COOKIE['lco'] == "O")) {
        // lco = List, Compact or compactlO;
        $_SESSION['lco'] = $_COOKIE['lco'];
    } elseif (!array_key_exists('lco', $_SESSION) || !($_SESSION['lco'] == "L" || $_SESSION['lco'] == "C" || $_SESSION['lco'] == "O")) {
        $cookietime = time() + 365 * 24 * 60 * 60;
        // 1 year
        setcookie("lco", "L", $cookietime, "/");
        $_SESSION['lco'] = "L";
    }
    if ($_SESSION['lco'] == "O" && !$loggedUser) {
        $_SESSION['lco'] = "L";
    }
    // pagenumbers ================================================================================================================================================================
    if (!array_key_exists('steps', $_SESSION)) {
        if (array_key_exists('steps', $_COOKIE)) {
            $stepsbase = explode(";", $_COOKIE['steps']);
            while (list($key, $value) = each($stepsbase)) {
                if ($value) {
                    $stepsbaseitems = explode(":", $value);
                    $_SESSION['steps'][$stepsbaseitems[0]] = $stepsbaseitems[1];
                }
            }
        }
    }
    $step = 25;
    if (array_key_exists('multiplepagenr', $_GET)) {
        $min = ($_GET['multiplepagenr'] - 1) * $step;
    } elseif (array_key_exists('multiplepagenr', $_POST)) {
        $min = ($_POST['multiplepagenr'] - 1) * $step;
    } elseif (array_key_exists('min', $_GET)) {
        $min = $_GET['min'];
    } else {
        $min = 0;
    }
    if ($stepsType = $objUtil->checkGetKey('stepsCommand')) {
        $steps = (int) $objUtil->checkGetKey('stepsValue', 25);
        if (!$steps || $steps < 1) {
            $steps = 25;
        }
        $_SESSION['steps'][$stepsType] = $steps;
        reset($_SESSION['steps']);
        $stepscookie = "";
        while (list($key, $value) = each($_SESSION['steps'])) {
            $stepscookie .= $key . ":" . $value . ";";
        }
        $cookietime = time() + 365 * 24 * 60 * 60;
        // 1 year
        setcookie("steps", $stepscookie, $cookietime, "/");
        reset($_SESSION['steps']);
    }
    // collapsed menus ================================================================================================================================================================
    if (array_key_exists('menuDownloads', $_GET)) {
        $menuDownloads = $_GET['menuDownloads'];
        $_SESSION['menus']['menuDownloads'] = $menuDownloads;
        $menuscookie = "";
        while (list($key, $value) = each($_SESSION['menus'])) {
            $menuscookie .= $key . ":" . $value . ";";
//.........这里部分代码省略.........
开发者ID:rolfvandervleuten,项目名称:DeepskyLog,代码行数:101,代码来源:instructions.php


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