• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP setUserActive函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: lang

UserCake Version: 2.0.1
http://usercake.com
*/
require_once "models/config.php";
if (!securePage($_SERVER['PHP_SELF'])) {
    die;
}
//Get token param
if (isset($_GET["token"])) {
    $token = $_GET["token"];
    if (!isset($token)) {
        $errors[] = lang("FORGOTPASS_INVALID_TOKEN");
    } else {
        if (!validateActivationToken($token)) {
            $errors[] = lang("ACCOUNT_TOKEN_NOT_FOUND");
        } else {
            //Activate the users account
            if (!setUserActive($token)) {
                $errors[] = lang("SQL_ERROR");
            }
        }
    }
} else {
    $errors[] = lang("FORGOTPASS_INVALID_TOKEN");
}
if (count($errors) == 0) {
    $successes[] = lang("ACCOUNT_ACTIVATION_COMPLETE");
}
require_once "models/header.php";
include "left-nav.php";
echo resultBlock($errors, $successes);
开发者ID:garnaudov,项目名称:webapp,代码行数:31,代码来源:activate-account.php


示例2: lang

         $errors[] = lang("ACCOUNT_DISPLAY_CHAR_LIMIT", array(5, 25));
     } elseif (!ctype_alnum($displayname)) {
         $errors[] = lang("ACCOUNT_DISPLAY_INVALID_CHARACTERS");
     } else {
         if (updateDisplayName($userId, $displayname)) {
             $successes[] = lang("ACCOUNT_DISPLAYNAME_UPDATED", array($displayname));
         } else {
             $errors[] = lang("SQL_ERROR");
         }
     }
 } else {
     $displayname = $userdetails['display_name'];
 }
 //Activate account
 if (isset($_POST['activate']) && $_POST['activate'] == "activate") {
     if (setUserActive($userdetails['activation_token'])) {
         $successes[] = lang("ACCOUNT_MANUALLY_ACTIVATED", array($displayname));
     } else {
         $errors[] = lang("SQL_ERROR");
     }
 }
 //Update email
 if ($userdetails['email'] != $_POST['email']) {
     $email = trim($_POST["email"]);
     //Validate email
     if (!isValidEmail($email)) {
         $errors[] = lang("ACCOUNT_INVALID_EMAIL");
     } elseif (emailExists($email)) {
         $errors[] = lang("ACCOUNT_EMAIL_IN_USE", array($email));
     } else {
         if (updateEmail($userId, $email)) {
开发者ID:marwyre,项目名称:PerunioCMS,代码行数:31,代码来源:user.php


示例3: index

 public function index()
 {
     /*
     UserCake (Via CupCake) Version: 2.0.2
     http://usercake.com
     */
     global $baseURL;
     require_once "{$baseURL}/application/third_party/user_cake/models/config.php";
     if (!securePage($_SERVER['PHP_SELF'])) {
         die;
     }
     $userId = $_GET['id'];
     //Check if selected user exists
     if (!userIdExists($userId)) {
         header("Location: " . str_replace('index.php/', '', site_url('admin_users')));
         die;
     }
     $userdetails = fetchUserDetails(NULL, NULL, $userId);
     //Fetch user details
     //Forms posted
     if (!empty($_POST)) {
         //Delete selected account
         if (!empty($_POST['delete'])) {
             $deletions = $_POST['delete'];
             if ($deletion_count = deleteUsers($deletions)) {
                 $successes[] = lang("ACCOUNT_DELETIONS_SUCCESSFUL", array($deletion_count));
             } else {
                 $errors[] = lang("SQL_ERROR");
             }
         } else {
             //Update display name
             if ($userdetails['display_name'] != $_POST['display']) {
                 $displayname = trim($_POST['display']);
                 //Validate display name
                 if (displayNameExists($displayname)) {
                     $errors[] = lang("ACCOUNT_DISPLAYNAME_IN_USE", array($displayname));
                 } elseif (minMaxRange(5, 25, $displayname)) {
                     $errors[] = lang("ACCOUNT_DISPLAY_CHAR_LIMIT", array(5, 25));
                 } elseif (!ctype_alnum($displayname)) {
                     $errors[] = lang("ACCOUNT_DISPLAY_INVALID_CHARACTERS");
                 } else {
                     if (updateDisplayName($userId, $displayname)) {
                         $successes[] = lang("ACCOUNT_DISPLAYNAME_UPDATED", array($displayname));
                     } else {
                         $errors[] = lang("SQL_ERROR");
                     }
                 }
             } else {
                 $displayname = $userdetails['display_name'];
             }
             //Activate account
             if (isset($_POST['activate']) && $_POST['activate'] == "activate") {
                 if (setUserActive($userdetails['activation_token'])) {
                     $successes[] = lang("ACCOUNT_MANUALLY_ACTIVATED", array($displayname));
                 } else {
                     $errors[] = lang("SQL_ERROR");
                 }
             }
             //Update email
             if ($userdetails['email'] != $_POST['email']) {
                 $email = trim($_POST["email"]);
                 //Validate email
                 if (!isValidEmail($email)) {
                     $errors[] = lang("ACCOUNT_INVALID_EMAIL");
                 } elseif (emailExists($email)) {
                     $errors[] = lang("ACCOUNT_EMAIL_IN_USE", array($email));
                 } else {
                     if (updateEmail($userId, $email)) {
                         $successes[] = lang("ACCOUNT_EMAIL_UPDATED");
                     } else {
                         $errors[] = lang("SQL_ERROR");
                     }
                 }
             }
             //Update title
             if ($userdetails['title'] != $_POST['title']) {
                 $title = trim($_POST['title']);
                 //Validate title
                 if (minMaxRange(1, 50, $title)) {
                     $errors[] = lang("ACCOUNT_TITLE_CHAR_LIMIT", array(1, 50));
                 } else {
                     if (updateTitle($userId, $title)) {
                         $successes[] = lang("ACCOUNT_TITLE_UPDATED", array($displayname, $title));
                     } else {
                         $errors[] = lang("SQL_ERROR");
                     }
                 }
             }
             //Remove permission level
             if (!empty($_POST['removePermission'])) {
                 $remove = $_POST['removePermission'];
                 if ($deletion_count = removePermission($remove, $userId)) {
                     $successes[] = lang("ACCOUNT_PERMISSION_REMOVED", array($deletion_count));
                 } else {
                     $errors[] = lang("SQL_ERROR");
                 }
             }
             if (!empty($_POST['addPermission'])) {
                 $add = $_POST['addPermission'];
                 if ($addition_count = addPermission($add, $userId)) {
//.........这里部分代码省略.........
开发者ID:AdwayLele,项目名称:CupCake,代码行数:101,代码来源:admin_user.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP setUserContext函数代码示例发布时间:2022-05-15
下一篇:
PHP setUri函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap