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


PHP form_auth函数代码示例

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


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

示例1: exit

#
#	Site: http://www.google.com
#
#	$Id: seo.inc.php 121 2014-03-04 12:38:05Z along $
#
#	Copyright (C) 2008-2014 PHPDisk Team. All Rights Reserved.
#
*/
if (!defined('IN_PHPDISK') || !defined('IN_ADMINCP')) {
    exit('[PHPDisk] Access Denied');
}
admin_no_power($task, 31, $pd_uid);
switch ($action) {
    default:
        if ($task == 'update_setting') {
            form_auth(gpc('formhash', 'P', ''), formhash());
            $meta_title = trim(gpc('meta_title', 'P', ''));
            $meta_keywords = trim(gpc('meta_keywords', 'P', ''));
            $meta_description = trim(gpc('meta_description', 'P', ''));
            $meta_title2 = trim(gpc('meta_title2', 'P', ''));
            $meta_keywords2 = trim(gpc('meta_keywords2', 'P', ''));
            $meta_description2 = trim(gpc('meta_description2', 'P', ''));
            $meta_title3 = trim(gpc('meta_title3', 'P', ''));
            $meta_keywords3 = trim(gpc('meta_keywords3', 'P', ''));
            $meta_description3 = trim(gpc('meta_description3', 'P', ''));
            $meta_title_s = trim(gpc('meta_title_s', 'P', ''));
            $meta_keywords_s = trim(gpc('meta_keywords_s', 'P', ''));
            $meta_description_s = trim(gpc('meta_description_s', 'P', ''));
            $meta_title_v = trim(gpc('meta_title_v', 'P', ''));
            $meta_keywords_v = trim(gpc('meta_keywords_v', 'P', ''));
            $meta_description_v = trim(gpc('meta_description_v', 'P', ''));
开发者ID:saintho,项目名称:phpdisk,代码行数:31,代码来源:seo.inc.php

示例2: auth_task_guest

function auth_task_guest()
{
    global $db, $tpf, $pd_uid, $pd_gid;
    form_auth(gpc('formhash', 'P', ''), formhash());
    $username = trim(gpc('username', 'P', ''));
    $password = trim(gpc('password', 'P', ''));
    $confirm_password = trim(gpc('confirm_password', 'P', ''));
    $email = trim(gpc('email', 'P', ''));
    $ref = trim(gpc('ref', 'P', ''));
    if (checklength($username, 2, 60)) {
        $error = true;
        $sysmsg[] = __('invalid_username');
    } elseif (is_bad_chars($username)) {
        $error = true;
        $sysmsg[] = __('username_has_bad_chars');
    } else {
        $rs = $db->fetch_one_array("select username from {$tpf}users where username='{$username}' and userid<>'{$pd_uid}' limit 1");
        if ($rs) {
            if (strcasecmp($username, $rs['username']) == 0) {
                $error = true;
                $sysmsg[] = __('username_already_exists');
            }
        }
        unset($rs);
    }
    if (checklength($password, 6, 20)) {
        $error = true;
        $sysmsg[] = __('invalid_password');
    } else {
        if ($password == $confirm_password) {
            $md5_pwd = md5($password);
        } else {
            $error = true;
            $sysmsg[] = __('confirm_password_invalid');
        }
    }
    if (!checkemail($email)) {
        $error = true;
        $sysmsg[] = __('invalid_email');
    } else {
        $rs = $db->fetch_one_array("select email from {$tpf}users where email='{$email}' and userid<>'{$pd_uid}' limit 1");
        if ($rs) {
            if (strcasecmp($email, $rs['email']) == 0) {
                $error = true;
                $sysmsg[] = __('email_already_exists');
            }
            unset($rs);
        }
    }
    if (!$error) {
        $ins = array('username' => $username, 'password' => $md5_pwd, 'email' => $email, 'space_name' => $username . __('file'), 'can_edit' => 0);
        $db->query_unbuffered("update {$tpf}users set " . $db->sql_array($ins) . " where userid='{$pd_uid}'");
        pd_setcookie('phpdisk_zcore_info', pd_encode("{$pd_uid}\t{$pd_gid}\t{$username}\t{$md5_pwd}\t{$email}"), 86400 * 3);
        $sysmsg[] = __('guest_set_account_success');
        tb_redirect($ref, $sysmsg);
    } else {
        tb_redirect('back', $sysmsg);
    }
}
开发者ID:saintho,项目名称:phpdisk,代码行数:59,代码来源:phpdisk.p.inc.php


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