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

PHP fn_rand函数代码示例

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

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



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

示例1: mdl_const

 function mdl_const($str_type)
 {
     $_str_content = "<?php" . PHP_EOL;
     foreach ($this->arr_const[$str_type] as $_key => $_value) {
         if (is_numeric($_value)) {
             $_str_content .= "define(\"" . $_key . "\", " . $_value . ");" . PHP_EOL;
         } else {
             $_str_content .= "define(\"" . $_key . "\", \"" . str_replace(PHP_EOL, "|", $_value) . "\");" . PHP_EOL;
         }
     }
     if ($str_type == "base") {
         $_str_content .= "define(\"BG_SITE_SSIN\", \"" . fn_rand(6) . "\");" . PHP_EOL;
     } else {
         if ($str_type == "visit") {
             if (!isset($this->arr_const[$str_type]["BG_VISIT_FILE"]) && $this->arr_const[$str_type]["BG_VISIT_TYPE"] != "static") {
                 $_str_content .= "define(\"BG_VISIT_FILE\", \"html\");" . PHP_EOL;
             }
         }
     }
     $_str_content = str_replace("||", "", $_str_content);
     $_num_size = file_put_contents(BG_PATH_CONFIG . "opt_" . $str_type . ".inc.php", $_str_content);
     if ($_num_size > 0) {
         $_str_alert = "y060101";
     } else {
         $_str_alert = "x060101";
     }
     return array("alert" => $_str_alert);
 }
开发者ID:xiaodin1,项目名称:baigoCMS,代码行数:28,代码来源:opt.class.php


示例2: mdl_submit

 /** 提交
  * mdl_submit function.
  *
  * @access public
  * @return void
  */
 function mdl_submit()
 {
     $_arr_appData = array("app_name" => $this->appSubmit["app_name"], "app_notice" => $this->appSubmit["app_notice"], "app_note" => $this->appSubmit["app_note"], "app_status" => $this->appSubmit["app_status"], "app_ip_allow" => $this->appSubmit["app_ip_allow"], "app_ip_bad" => $this->appSubmit["app_ip_bad"], "app_sync" => $this->appSubmit["app_sync"], "app_allow" => $this->appSubmit["app_allow"]);
     if ($this->appSubmit["app_id"] < 1) {
         $_str_appKey = fn_rand(64);
         $_arr_insert = array("app_key" => $_str_appKey, "app_time" => time());
         $_arr_data = array_merge($_arr_appData, $_arr_insert);
         $_num_appId = $this->obj_db->insert(BG_DB_TABLE . "app", $_arr_data);
         //更新数据
         if ($_num_appId > 0) {
             $_str_alert = "y050101";
             //更新成功
         } else {
             return array("alert" => "x050101");
         }
     } else {
         $_str_appKey = "";
         $_num_appId = $this->appSubmit["app_id"];
         $_num_mysql = $this->obj_db->update(BG_DB_TABLE . "app", $_arr_appData, "app_id=" . $_num_appId);
         //更新数据
         if ($_num_mysql > 0) {
             $_str_alert = "y050103";
             //更新成功
         } else {
             return array("alert" => "x050103");
         }
     }
     return array("app_id" => $_num_appId, "app_key" => $_str_appKey, "alert" => $_str_alert);
 }
开发者ID:itviewer,项目名称:baigoSSO,代码行数:35,代码来源:app.class.php


示例3: mdl_const

 function mdl_const($str_type)
 {
     if (!fn_token("chk")) {
         //令牌
         $this->obj_ajax->halt_alert("x030102");
     }
     $_arr_opt = fn_post("opt");
     $_str_content = "<?php" . PHP_EOL;
     foreach ($_arr_opt as $_key => $_value) {
         $_arr_optChk = validateStr($_value, 1, 900);
         $_str_optValue = $_arr_optChk["str"];
         if (is_numeric($_value)) {
             $_str_content .= "define(\"" . $_key . "\", " . $_str_optValue . ");" . PHP_EOL;
         } else {
             $_str_content .= "define(\"" . $_key . "\", \"" . str_replace(PHP_EOL, "|", $_str_optValue) . "\");" . PHP_EOL;
         }
     }
     if ($str_type == "base") {
         $_str_content .= "define(\"BG_SITE_SSIN\", \"" . fn_rand(6) . "\");" . PHP_EOL;
     } else {
         if ($str_type == "visit") {
             if ($_arr_opt["BG_VISIT_TYPE"] != "static") {
                 $_str_content .= "define(\"BG_VISIT_FILE\", \"html\");" . PHP_EOL;
             }
         }
     }
     $_str_content = str_replace("||", "", $_str_content);
     $_num_size = file_put_contents(BG_PATH_CONFIG . "opt_" . $str_type . ".inc.php", $_str_content);
     if ($_num_size > 0) {
         $_str_alert = "y060101";
     } else {
         $_str_alert = "x060101";
     }
     return array("alert" => $_str_alert);
 }
开发者ID:richardcj,项目名称:baigoCMS,代码行数:35,代码来源:opt.class.php


示例4: mdl_const

 function mdl_const($str_type)
 {
     if (!fn_token("chk")) {
         //令牌
         return array("alert" => "x030102");
         exit;
     }
     $_str_content = "<?php" . PHP_EOL;
     foreach ($this->arr_const[$str_type] as $_key => $_value) {
         if (is_numeric($_value)) {
             $_str_content .= "define(\"" . $_key . "\", " . $_value . ");" . PHP_EOL;
         } else {
             $_str_content .= "define(\"" . $_key . "\", \"" . str_replace(PHP_EOL, "|", $_value) . "\");" . PHP_EOL;
         }
     }
     if ($str_type == "base") {
         $_str_content .= "define(\"BG_SITE_SSIN\", \"" . fn_rand(6) . "\");" . PHP_EOL;
     }
     $_str_content = str_replace("||", "", $_str_content);
     $_num_size = file_put_contents(BG_PATH_CONFIG . "opt_" . $str_type . ".inc.php", $_str_content);
     if ($_num_size > 0) {
         $_str_alert = "y040101";
     } else {
         $_str_alert = "x040101";
     }
     return array("alert" => $_str_alert);
 }
开发者ID:humor-zo,项目名称:baigoADS,代码行数:27,代码来源:opt.class.php


示例5: mdl_submit

 /** 提交
  * mdl_submit function.
  *
  * @access public
  * @return void
  */
 function mdl_submit($num_userId, $str_mail)
 {
     $_arr_verifyRow = $this->mdl_read($num_userId, "verify_user_id");
     $_str_rand = fn_rand(6);
     $_str_token = fn_rand(32);
     $_str_tokenDo = fn_baigoEncrypt($_str_token, $_str_rand);
     $_arr_verifyData = array("verify_user_id" => $num_userId, "verify_mail" => $str_mail, "verify_token" => $_str_token, "verify_rand" => $_str_rand, "verify_token_expire" => time() + BG_VERIFY_EXPIRE * 60, "verify_status" => "enable", "verify_time_refresh" => time());
     if ($_arr_verifyRow["alert"] == "x120102") {
         $_arr_verifyData["verify_time"] = time();
         $_num_verifyId = $this->obj_db->insert(BG_DB_TABLE . "verify", $_arr_verifyData);
         //更新数据
         if ($_num_verifyId > 0) {
             $_str_alert = "y120101";
             //更新成功
         } else {
             return array("alert" => "x120101");
         }
     } else {
         $_num_verifyId = $_arr_verifyRow["verify_id"];
         $_num_mysql = $this->obj_db->update(BG_DB_TABLE . "verify", $_arr_verifyData, "verify_id=" . $_num_verifyId);
         //更新数据
         if ($_num_mysql > 0) {
             $_str_alert = "y120103";
             //更新成功
         } else {
             return array("alert" => "x120103");
         }
     }
     return array("verify_id" => $_num_verifyId, "verify_token" => $_str_tokenDo, "alert" => $_str_alert);
 }
开发者ID:itviewer,项目名称:baigoSSO,代码行数:36,代码来源:verify.class.php


示例6: notice_login

 /**
  * notice_list function.
  *
  * @access public
  * @return void
  */
 function notice_login()
 {
     $_arr_noticeGet = $this->obj_notice->notice_get("get");
     if ($_arr_noticeGet["alert"] != "ok") {
         $this->obj_notice->halt_re($_arr_noticeGet);
     }
     $_tm_now = time();
     if ($_arr_noticeGet["time"] - $_tm_now > 300) {
         $_arr_return = array("alert" => "x220213");
         $this->obj_notice->halt_re($_arr_return);
     }
     $_arr_signature = $this->obj_sso->sso_verify($_arr_noticeGet["time"], $_arr_noticeGet["random"], $_arr_noticeGet["signature"]);
     if ($_arr_signature["alert"] != "y050403") {
         $this->obj_notice->halt_re($_arr_signature);
     }
     $_arr_decode = $this->obj_sso->sso_decode($_arr_noticeGet["code"], $_arr_noticeGet["key"]);
     $_arr_adminRow = $this->mdl_admin->mdl_read($_arr_decode["user_id"]);
     if ($_arr_adminRow["alert"] != "y020102") {
         $this->obj_notice->halt_re($_arr_adminRow);
     }
     if ($_arr_adminRow["admin_status"] == "disable") {
         $_arr_return = array("alert" => "x020401");
         $this->obj_notice->halt_re($_arr_return);
     }
     $_str_rand = fn_rand(6);
     $this->mdl_admin->mdl_login($_arr_decode["user_id"], $_str_rand);
     fn_session("admin_id", "mk", $_arr_decode["user_id"]);
     fn_session("admin_ssin_time", "mk", time());
     fn_session("admin_hash", "mk", fn_baigoEncrypt($_arr_adminRow["admin_time"], $_str_rand));
     $this->obj_notice->halt_re($_arr_adminRow);
 }
开发者ID:richardcj,项目名称:baigoCMS,代码行数:37,代码来源:admin.class.php


示例7: ctl_login

 /**
  * ctl_login function.
  *
  * @access public
  * @return void
  */
 function ctl_login()
 {
     $_arr_adminLogin = $this->mdl_admin->input_login();
     if ($_arr_adminLogin["alert"] != "ok") {
         return $_arr_adminLogin;
         exit;
     }
     $_arr_adminRow = $this->mdl_admin->mdl_read($_arr_adminLogin["admin_name"], "admin_name");
     if ($_arr_adminRow["alert"] != "y020102") {
         return $_arr_adminRow;
         exit;
     }
     if (fn_baigoEncrypt($_arr_adminLogin["admin_pass"], $_arr_adminRow["admin_rand"]) != $_arr_adminRow["admin_pass"]) {
         return array("forward" => $_arr_adminLogin["forward"], "alert" => "x020207");
         exit;
     }
     if ($_arr_adminRow["admin_status"] != "enable") {
         return array("forward" => $_arr_adminLogin["forward"], "alert" => "x020402");
         exit;
     }
     $_str_adminRand = fn_rand(6);
     $this->mdl_admin->mdl_login($_arr_adminRow["admin_id"], fn_baigoEncrypt($_arr_adminLogin["admin_pass"], $_str_adminRand), $_str_adminRand);
     fn_session("admin_id", "mk", $_arr_adminRow["admin_id"]);
     fn_session("admin_ssin_time", "mk", time());
     fn_session("admin_hash", "mk", fn_baigoEncrypt($_arr_adminRow["admin_time"], $_str_adminRand));
     return array("admin_id" => $_arr_adminLogin["admin_id"], "forward" => $_arr_adminLogin["forward"], "alert" => "y020201");
 }
开发者ID:gorgee,项目名称:baigoADS,代码行数:33,代码来源:logon.class.php


示例8: mdl_const

 /** 处理常量并生成配置文件
  * mdl_const function.
  *
  * @access public
  * @param mixed $str_type
  * @return void
  */
 function mdl_const($str_type)
 {
     if (!fn_token("chk")) {
         //令牌
         return array("alert" => "x030206");
     }
     $_str_content = "<?php" . PHP_EOL;
     foreach ($this->arr_const[$str_type] as $_key => $_value) {
         if (is_numeric($_value)) {
             $_str_content .= "define(\"" . $_key . "\", " . $_value . ");" . PHP_EOL;
         } else {
             $_str_content .= "define(\"" . $_key . "\", \"" . rtrim(str_ireplace(PHP_EOL, "|", $_value), "/\\") . "\");" . PHP_EOL;
         }
     }
     if ($str_type == "base") {
         $_str_content .= "define(\"BG_SITE_SSIN\", \"" . fn_rand(6) . "\");" . PHP_EOL;
         $_str_content .= "define(\"BG_SITE_TPL\", \"default\");" . PHP_EOL;
     }
     $_str_content = str_ireplace("||", "", $_str_content);
     $_num_size = $this->obj_dir->put_file(BG_PATH_CONFIG . "opt_" . $str_type . ".inc.php", $_str_content);
     if ($_num_size > 0) {
         $_str_alert = "y030405";
     } else {
         $_str_alert = "x030405";
     }
     return array("alert" => $_str_alert);
 }
开发者ID:baigoStudio,项目名称:baigoSSO,代码行数:34,代码来源:opt.class.php


示例9: __construct

 function __construct()
 {
     //构造函数
     $this->obj_dir = new CLASS_DIR();
     if (!file_exists(BG_PATH_CACHE . "sys/crypt_key_pub.txt")) {
         $this->obj_dir->put_file(BG_PATH_CACHE . "sys/crypt_key_pub.txt", fn_rand());
     }
     $this->key_pub = file_get_contents(BG_PATH_CACHE . "sys/crypt_key_pub.txt");
 }
开发者ID:baigoStudio,项目名称:baigoSSO,代码行数:9,代码来源:crypt.class.php


示例10: ajax_submit

 /**
  * ajax_submit function.
  *
  * @access public
  * @return void
  */
 function ajax_submit()
 {
     $_arr_adminSubmit = $this->mdl_admin->input_submit();
     if ($_arr_adminSubmit["alert"] != "ok") {
         $this->obj_ajax->halt_alert($_arr_adminSubmit["alert"]);
     }
     $_str_adminPassDo = "";
     $_str_adminRand = "";
     if ($_arr_adminSubmit["admin_id"] > 0) {
         if (!isset($this->adminLogged["admin_allow"]["admin"]["edit"]) && !$this->is_super) {
             $this->obj_ajax->halt_alert("x020303");
         }
         if ($_arr_adminSubmit["admin_id"] == $this->adminLogged["admin_id"] && !$this->is_super) {
             $this->obj_ajax->halt_alert("x020306");
         }
         $_str_adminPass = fn_post("admin_pass");
         if (!fn_isEmpty($_str_adminPass)) {
             $_str_adminRand = fn_rand(6);
             $_str_adminPassDo = fn_baigoEncrypt($_str_adminPass, $_str_adminRand);
         }
     } else {
         if (!isset($this->adminLogged["admin_allow"]["admin"]["add"]) && !$this->is_super) {
             $this->obj_ajax->halt_alert("x020302");
         }
         $_arr_adminPass = validateStr(fn_post("admin_pass"), 1, 0);
         switch ($_arr_adminPass["status"]) {
             case "too_short":
                 $this->obj_ajax->halt_alert("x020205");
                 break;
             case "ok":
                 $_str_adminPass = $_arr_adminPass["str"];
                 break;
         }
         $_str_adminRand = fn_rand(6);
         $_str_adminPassDo = fn_baigoEncrypt($_str_adminPass, $_str_adminRand);
     }
     $_arr_adminRow = $this->mdl_admin->mdl_submit($_str_adminPassDo, $_str_adminRand);
     if ($_arr_adminRow["alert"] == "y020101" || $_arr_adminRow["alert"] == "y020103") {
         $_arr_targets[] = array("admin_id" => $_arr_adminRow["admin_id"]);
         $_str_targets = json_encode($_arr_targets);
         if ($_arr_adminRow["alert"] == "y020101") {
             $_type = "add";
         } else {
             $_type = "edit";
         }
         $_str_adminRow = json_encode($_arr_adminRow);
         $_arr_logData = array("log_targets" => $_str_targets, "log_target_type" => "admin", "log_title" => $this->log["admin"][$_type], "log_result" => $_str_adminRow, "log_type" => "admin");
         $this->mdl_log->mdl_submit($_arr_logData, $this->adminLogged["admin_id"]);
     }
     $this->obj_ajax->halt_alert($_arr_adminRow["alert"]);
 }
开发者ID:baigoStudio,项目名称:baigoADS,代码行数:57,代码来源:admin.class.php


示例11: api_admin

 function api_admin()
 {
     $this->check_db();
     include_once BG_PATH_MODEL . "admin.class.php";
     //载入管理帐号模型
     $_mdl_admin = new MODEL_ADMIN();
     $_arr_adminAdd = $_mdl_admin->api_add();
     if ($_arr_adminAdd["alert"] != "ok") {
         $this->obj_api->halt_re($_arr_adminAdd);
     }
     $_str_rand = fn_rand(6);
     $_str_adminPassDo = fn_baigoEncrypt($_arr_adminAdd["admin_pass"], $_str_rand, true);
     $_arr_adminRow = $_mdl_admin->mdl_submit($_str_adminPassDo, $_str_rand);
     $this->obj_api->halt_re($_arr_adminRow);
 }
开发者ID:itviewer,项目名称:baigoSSO,代码行数:15,代码来源:install.class.php


示例12: api_encode

 /**
  * api_encode function.
  *
  * @access public
  * @return void
  */
 function api_encode()
 {
     $this->app_check("post");
     $_arr_data = validateStr(fn_post("data"), 1, 0);
     switch ($_arr_data["status"]) {
         case "too_short":
             $_arr_return = array("alert" => "x080201");
             $this->obj_api->halt_re($_arr_return);
             break;
         case "ok":
             $_str_data = html_entity_decode($_arr_data["str"]);
             break;
     }
     $_str_key = fn_rand(6);
     $_str_code = fn_baigoEncode($_str_data, $_str_key);
     $_arr_return = array("code" => $_str_code, "key" => $_str_key, "alert" => "y050405");
     $this->obj_api->halt_re($_arr_return);
 }
开发者ID:itviewer,项目名称:baigoSSO,代码行数:24,代码来源:code.class.php


示例13: fn_ssin_login

function fn_ssin_login($num_adminId)
{
    $_mdl_admin = new MODEL_ADMIN();
    //设置管理员对象
    $_arr_adminRow = $_mdl_admin->mdl_read($num_adminId);
    //本地数据库处理
    if ($_arr_adminRow["alert"] != "y020102") {
        return $_arr_adminRow;
    }
    if ($_arr_adminRow["admin_status"] == "disable") {
        return array("alert" => "x020401");
    }
    $_str_rand = fn_rand(6);
    $_mdl_admin->mdl_login($num_adminId, $_str_rand);
    fn_session("admin_id", "mk", $num_adminId);
    fn_session("admin_ssin_time", "mk", time());
    fn_session("admin_hash", "mk", fn_baigoEncrypt($_arr_adminRow["admin_time"], $_str_rand));
    return array("alert" => "ok");
}
开发者ID:baigoStudio,项目名称:baigoADS,代码行数:19,代码来源:session.func.php


示例14: ctl_login

 /**
  * ctl_login function.
  *
  * @access public
  * @return void
  */
 function ctl_login()
 {
     $_arr_adminLogin = $this->input_login();
     if ($_arr_adminLogin["alert"] != "ok") {
         return $_arr_adminLogin;
         exit;
     }
     $_arr_ssoLogin = $this->obj_sso->sso_login($_arr_adminLogin["admin_name"], $_arr_adminLogin["admin_pass"]);
     //sso验证
     if ($_arr_ssoLogin["alert"] != "y010401") {
         $_arr_ssoLogin["forward"] = $_arr_adminLogin["forward"];
         return $_arr_ssoLogin;
         exit;
     }
     $_arr_adminRow = $this->mdl_admin->mdl_read($_arr_ssoLogin["user_id"]);
     //本地数据库处理
     if ($_arr_adminRow["alert"] != "y020102") {
         $_arr_adminRow["forward"] = $_arr_adminLogin["forward"];
         return $_arr_adminRow;
         exit;
     }
     if ($_arr_adminRow["admin_status"] == "disable") {
         return array("forward" => $_arr_adminLogin["forward"], "alert" => "x020401");
         exit;
     }
     $_str_rand = fn_rand(6);
     $this->mdl_admin->mdl_login($_arr_ssoLogin["user_id"], $_str_rand);
     fn_session("admin_id", "mk", $_arr_ssoLogin["user_id"]);
     fn_session("admin_ssin_time", "mk", time());
     fn_session("admin_hash", "mk", fn_baigoEncrypt($_arr_adminRow["admin_time"], $_str_rand));
     if (defined("BG_SSO_SYNLOGON") && BG_SSO_SYNLOGON == "on") {
         $_arr_sync = $this->obj_sso->sso_sync_login($_arr_ssoLogin["user_id"]);
         echo $_arr_sync["html"];
     }
     exit;
     return array("admin_id" => $_arr_ssoLogin["user_id"], "forward" => $_arr_adminLogin["forward"], "alert" => "y020401");
 }
开发者ID:richardcj,项目名称:baigoCMS,代码行数:43,代码来源:logon.class.php


示例15: ajax_submit

 function ajax_submit()
 {
     $_arr_userSubmit = $this->mdl_user->input_submit();
     $_str_userPassDo = "";
     $_str_userRand = "";
     if ($_arr_userSubmit["alert"] != "ok") {
         $this->obj_ajax->halt_alert($_arr_userSubmit["alert"]);
     }
     if ($_arr_userSubmit["user_id"] > 0) {
         if (!isset($this->adminLogged["admin_allow"]["user"]["edit"])) {
             $this->obj_ajax->halt_alert("x010303");
         }
         $_str_userPass = fn_post("user_pass");
         if ($_str_userPass) {
             $_str_userRand = fn_rand(6);
             $_str_userPassDo = fn_baigoEncrypt($_str_userPass, $_str_userRand);
         }
     } else {
         if (!isset($this->adminLogged["admin_allow"]["user"]["add"])) {
             $this->obj_ajax->halt_alert("x010302");
         }
         $_arr_userPass = validateStr(fn_post("user_pass"), 1, 0);
         switch ($_arr_userPass["status"]) {
             case "too_short":
                 $this->obj_ajax->halt_alert("x010212");
                 break;
             case "ok":
                 $_str_userPass = $_arr_userPass["str"];
                 break;
         }
         $_str_userRand = fn_rand(6);
         $_str_userPassDo = fn_baigoEncrypt($_str_userPass, $_str_userRand);
     }
     $_arr_userRow = $this->mdl_user->mdl_submit($_str_userPassDo, $_str_userRand);
     $this->obj_ajax->halt_alert($_arr_userRow["alert"]);
 }
开发者ID:humor-zo,项目名称:baigoADS,代码行数:36,代码来源:user.class.php


示例16: ajax_admin

 function ajax_admin()
 {
     $this->check_db();
     include_once BG_PATH_MODEL . "admin.class.php";
     //载入管理帐号模型
     $_mdl_admin = new MODEL_ADMIN();
     $_arr_adminSubmit = $_mdl_admin->input_submit();
     if ($_arr_adminSubmit["alert"] != "ok") {
         $this->obj_ajax->halt_alert($_arr_adminSubmit["alert"]);
     }
     $_arr_adminPass = validateStr(fn_post("admin_pass"), 1, 0);
     switch ($_arr_adminPass["status"]) {
         case "too_short":
             $this->obj_ajax->halt_alert("x020205");
             break;
         case "ok":
             $_str_adminPass = $_arr_adminPass["str"];
             break;
     }
     $_arr_adminPassConfirm = validateStr(fn_post("admin_pass_confirm"), 1, 0);
     switch ($_arr_adminPassConfirm["status"]) {
         case "too_short":
             $this->obj_ajax->halt_alert("x020211");
             break;
         case "ok":
             $_str_adminPassConfirm = $_arr_adminPassConfirm["str"];
             break;
     }
     if ($_str_adminPass != $_str_adminPassConfirm) {
         $this->obj_ajax->halt_alert("x020206");
     }
     $_str_adminRand = fn_rand(6);
     $_str_adminPassDo = fn_baigoEncrypt($_str_adminPass, $_str_adminRand);
     $_arr_adminRow = $_mdl_admin->mdl_submit($_str_adminPassDo, $_str_adminRand);
     $this->obj_ajax->halt_alert("y030407");
 }
开发者ID:gorgee,项目名称:baigoADS,代码行数:36,代码来源:install.class.php


示例17: api_logout

 function api_logout()
 {
     $this->app_check("get");
     if (!isset($this->appAllow["user"]["login"])) {
         $_arr_return = array("alert" => "x050306");
         $_arr_logTarget[] = array("app_id" => $this->appGet["app_id"]);
         $_arr_logType = array("user", "get");
         $this->log_do($_arr_logTarget, "app", $_arr_return, $_arr_logType);
         $this->obj_sync->halt_re($_arr_return);
     }
     $_arr_userId = validateStr($this->appGet["user_id"], 1, 0, "str", "int");
     switch ($_arr_userId["status"]) {
         case "too_short":
             $_arr_return = array("alert" => "x010217");
             $this->obj_sync->halt_re($_arr_return);
             break;
         case "format_err":
             $_arr_return = array("alert" => "x010218");
             $this->obj_sync->halt_re($_arr_return);
             break;
         case "ok":
             $_num_userId = $_arr_userId["str"];
             break;
     }
     $_arr_userRow = $this->mdl_user->mdl_read($_num_userId);
     if ($_arr_userRow["alert"] != "y010102") {
         $this->obj_sync->halt_re($_arr_userRow);
     }
     if ($_arr_userRow["user_status"] != "enable") {
         $_arr_return = array("alert" => "x010401");
         $this->obj_api->halt_re($_arr_return);
     }
     unset($_arr_userRow["user_pass"], $_arr_userRow["user_mail"], $_arr_userRow["user_nick"], $_arr_userRow["user_note"], $_arr_userRow["user_rand"], $_arr_userRow["user_status"], $_arr_userRow["user_time"], $_arr_userRow["user_time_login"], $_arr_userRow["user_ip"]);
     $_str_key = fn_rand(6);
     $_arr_code = $_arr_userRow;
     $_str_sync = "";
     foreach ($this->appRows as $_key => $_value) {
         $_tm_time = time();
         $_str_rand = fn_rand();
         $_str_sign = fn_baigoSignMk($_tm_time, $_str_rand);
         $_arr_code["app_id"] = $_value["app_id"];
         $_arr_code["app_key"] = $_value["app_key"];
         $_str_code = $this->obj_sync->sync_encode($_arr_code, $_str_key);
         if (stristr($_value["app_notice"], "?")) {
             $_str_conn = "&";
         } else {
             $_str_conn = "?";
         }
         $_str_url = $_value["app_notice"] . $_str_conn . "act_get=logout&time=" . $_tm_time . "&random=" . $_str_rand . "&signature=" . $_str_sign . "&code=" . $_str_code . "&key=" . $_str_key;
         $_str_sync .= "<script type=\"text/javascript\" src=\"" . $_str_url . "\"></script>";
     }
     $_arr_return = array("alert" => "y100402", "html" => base64_encode($_str_sync));
     exit(fn_jsonEncode($_arr_return, "no"));
 }
开发者ID:richardcj,项目名称:baigoCMS,代码行数:54,代码来源:sync.class.php


示例18: api_edit

 /**
  * api_edit function.
  *
  * @access public
  * @return void
  */
 function api_edit()
 {
     $this->app_check("post");
     if (!isset($this->appAllow["user"]["edit"])) {
         $_arr_return = array("alert" => "x050308");
         $_arr_logTarget[] = array("app_id" => $this->appGet["app_id"]);
         $_arr_logType = array("user", "edit");
         $this->log_do($_arr_logTarget, "app", $_arr_return, $_arr_logType);
         $this->obj_api->halt_re($_arr_return);
     }
     $_arr_userEdit = $this->mdl_user->api_input_edit();
     if ($_arr_userEdit["alert"] != "ok") {
         $this->obj_api->halt_re($_arr_userEdit);
     }
     $_arr_userRow = $this->mdl_user->mdl_read($_arr_userEdit["user_str"], $_arr_userEdit["user_by"]);
     if ($_arr_userRow["alert"] != "y010102") {
         $this->obj_api->halt_re($_arr_userRow);
     }
     if (!isset($this->appAllow["user"]["global"])) {
         $_arr_appBelongRow = $this->mdl_appBelong->mdl_read($_arr_userRow["user_id"], $this->appGet["app_id"]);
         if ($_arr_appBelongRow["alert"] != "y070102") {
             $_arr_return = array("alert" => "x050308");
             $this->obj_api->halt_re($_arr_return);
         }
     }
     if ($_arr_userEdit["user_check_pass"] == true) {
         if (fn_baigoEncrypt($_arr_userEdit["user_pass"], $_arr_userRow["user_rand"], true) != $_arr_userRow["user_pass"]) {
             $_arr_return = array("alert" => "x010213");
             $this->obj_api->halt_re($_arr_return);
         }
     }
     if ($_arr_userRow["user_status"] != "enable") {
         return array("alert" => "x010401");
         exit;
     }
     if (BG_REG_ONEMAIL == "false" && BG_REG_NEEDMAIL == "on" && $_arr_userEdit["user_mail"]) {
         $_arr_userRow = $this->mdl_user->mdl_read($_arr_userEdit["user_mail"], "user_mail", $_arr_userRow["user_id"]);
         if ($_arr_userRow["alert"] == "y010102") {
             $_arr_return = array("alert" => "x010211");
             $this->obj_api->halt_re($_arr_return);
         }
     }
     //file_put_contents(BG_PATH_ROOT . "test.txt", $_str_userPass . "||" . $_str_rand);
     $_str_key = fn_rand(6);
     $_arr_userUpdate = $this->mdl_user->mdl_edit($_arr_userRow["user_id"]);
     $_arr_userUpdate["user_name"] = $_arr_userRow["user_name"];
     $_str_code = $this->obj_api->api_encode($_arr_userUpdate, $_str_key);
     $_arr_return = array("code" => $_str_code, "key" => $_str_key);
     //通知
     $_arr_notice = $_arr_return;
     $_arr_notice["act_post"] = "edit";
     $this->obj_api->api_notice($_arr_notice, $this->appRows);
     $_arr_return["alert"] = $_arr_userUpdate["alert"];
     $this->obj_api->halt_re($_arr_return);
 }
开发者ID:gorgee,项目名称:baigoADS,代码行数:61,代码来源:user.class.php


示例19: api_logout

 function api_logout()
 {
     $this->app_check("get");
     if (!isset($this->appRow["app_allow"]["user"]["login"])) {
         $_arr_return = array("alert" => "x050306");
         $_arr_logTarget[] = array("app_id" => $this->appRequest["app_id"]);
         $_arr_logType = array("user", "get");
         $this->log_do($_arr_logTarget, "app", $_arr_return, $_arr_logType);
         $this->obj_sync->halt_re($_arr_return);
     }
     $_arr_userId = validateStr($this->appRequest["user_id"], 1, 0, "str", "int");
     switch ($_arr_userId["status"]) {
         case "too_short":
             $_arr_return = array("alert" => "x010217");
             $this->obj_sync->halt_re($_arr_return);
             break;
         case "format_err":
             $_arr_return = array("alert" => "x010218");
             $this->obj_sync->halt_re($_arr_return);
             break;
         case "ok":
             $_num_userId = $_arr_userId["str"];
             break;
     }
     $_arr_userRow = $this->mdl_user->mdl_read($_num_userId);
     if ($_arr_userRow["alert"] != "y010102") {
         $this->obj_sync->halt_re($_arr_userRow);
     }
     if ($_arr_userRow["user_status"] != "enable") {
         $_arr_return = array("alert" => "x010401");
         $this->obj_api->halt_re($_arr_return);
     }
     unset($_arr_userRow["user_pass"], $_arr_userRow["user_mail"], $_arr_userRow["user_nick"], $_arr_userRow["user_note"], $_arr_userRow["user_rand"], $_arr_userRow["user_status"], $_arr_userRow["user_time"], $_arr_userRow["user_time_login"], $_arr_userRow["user_ip"]);
     $_str_key = fn_rand(6);
     $_arr_code = $_arr_userRow;
     $_arr_urlRows = array();
     foreach ($this->appRows as $_key => $_value) {
         $_tm_time = time();
         $_str_rand = fn_rand();
         $_str_sign = fn_baigoSignMk($_tm_time, $_str_rand);
         $_arr_code["app_id"] = $_value["app_id"];
         $_arr_code["app_key"] = $_value["app_key"];
         $_str_code = $this->obj_sync->sync_encode($_arr_code, $_str_key);
         if (stristr($_value["app_notice"], "?")) {
             $_str_conn = "&";
         } else {
             $_str_conn = "?";
         }
         $_str_url = $_value["app_notice"] . $_str_conn . "mod=sync";
         $_arr_data = array("act_get" => "logout", "time" => $_tm_time, "random" => $_str_rand, "signature" => $_str_sign, "code" => $_str_code, "key" => $_str_key);
         $_arr_urlRows[] = urlencode($_str_url . "&" . http_build_query($_arr_data));
     }
     $_arr_return = array("alert" => "y100402", "urlRows" => $_arr_urlRows);
     $this->obj_sync->halt_re($_arr_return);
 }
开发者ID:itviewer,项目名称:baigoSSO,代码行数:55,代码来源:sync.class.php


示例20: sso_sync_login

 /** 同步登录
  * sso_sync_login function.
  *
  * @access public
  * @param mixed $num_userId
  * @return void
  */
 function sso_sync_login($num_userId)
 {
     $_str_key = fn_rand(6);
     $_arr_data["user_id"] = $num_userId;
     $_arr_code = $this->sso_encode($_arr_data);
     $_tm_time = time();
     $_str_rand = fn_rand();
     $_arr_signature = $this->sso_signature($_tm_time, $_str_rand);
     if ($_arr_signature["alert"] != "y050404") {
         return $_arr_result;
         //返回错误信息
         exit;
     }
     $_arr_ssoData = array("act_get" => "login", "time" => $_tm_time, "random" => $_str_rand, "signature" => $_arr_signature["signature"], "code" => $_arr_code["code"], "key" => $_arr_code["key"]);
     $_arr_get = fn_http(BG_SSO_URL . "?mod=sync", $_arr_ssoData, "get");
     //提交
     $_arr_result = $this->result_process($_arr_get);
     if ($_arr_result["urls"]) {
         foreach ($_arr_result["urls"] as $_key => $_value) {
             $_arr_result["urls"][$_key] = base64_decode(urldecode($_value));
         }
     }
     return $_arr_result;
 }
开发者ID:humor-zo,项目名称:baigoADS,代码行数:31,代码来源:sso.class.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP fn_redirect函数代码示例发布时间:2022-05-15
下一篇:
PHP fn_query_remove函数代码示例发布时间: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