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


PHP GWF_User::insert方法代码示例

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


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

示例1: insert_bot

 private static function insert_bot($botname)
 {
     $user = new GWF_User(array('user_id' => 0, 'user_options' => GWF_User::BOT | GWF_User::WEBSPIDER, 'user_name' => $botname, 'user_password' => GWF_Password::hashPasswordS('webspider'), 'user_regdate' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'user_regip' => GWF_IP6::getIP(GWF_IP_EXACT, '127.0.0.1'), 'user_email' => '', 'user_gender' => 'no_gender', 'user_lastlogin' => 0, 'user_lastactivity' => 0, 'user_birthdate' => '00000000', 'user_avatar_v' => 0, 'user_countryid' => 0, 'user_langid' => 0, 'user_langid2' => 0, 'user_level' => 0, 'user_title' => '', 'user_settings' => NULL, 'user_data' => NULL, 'user_credits' => 0.0));
     if (false === $user->insert()) {
         return false;
     }
     echo "Inserted new Bot: {$botname}<br/>";
     return $user;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:GWF_AdminWebSpiders.php

示例2: onCrossRegister

 private function onCrossRegister($username)
 {
     $options = 0;
     $password = GWF_Random::randomKey();
     $user = new GWF_User(array('user_id' => 0, 'user_options' => $options, 'user_name' => $username, 'user_password' => GWF_Password::hashPasswordS($password), 'user_regdate' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'user_regip' => GWF_IP6::getIP(GWF_IP_EXACT), 'user_email' => '', 'user_gender' => 'no_gender', 'user_lastlogin' => time(), 'user_lastactivity' => time(), 'user_birthdate' => '00000000', 'user_avatar_v' => 0, 'user_countryid' => 0, 'user_langid' => 1, 'user_langid2' => 0, 'user_level' => 0, 'user_title' => '', 'user_settings' => '', 'user_data' => '', 'user_credits' => '0.00'));
     if (false === $user->insert()) {
         return false;
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:10,代码来源:CrossLogin.php

示例3: installPMBot

 private static function installPMBot(Module_PM $module)
 {
     $user = new GWF_User(array('user_name' => '_GWF_PM_BOT_', 'user_password' => 'x', 'user_regdate' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'user_regip' => GWF_IP6::getIP(GWF_IP_EXACT, '127.0.0.1'), 'user_email' => GWF_BOT_EMAIL, 'user_birthdate' => GWF_Time::getDate(GWF_Time::LEN_DAY), 'user_countryid' => 0, 'user_langid' => 0, 'user_options' => GWF_User::BOT, 'user_lastactivity' => time()));
     if (false === $user->insert()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if (false === GWF_ModuleLoader::saveModuleVar($module, 'pm_bot_uid', $user->getID())) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return '';
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:11,代码来源:GWF_PMInstall.php

示例4: onActivate

 public static function onActivate(Module_Register $module, $token, $byEmail)
 {
     $ua = GDO::table('GWF_UserActivation');
     if (false === ($row = $ua->getBy('token', $token))) {
         return $module->error('err_activate');
     }
     if ($module->hasIPActivatedRecently()) {
         return $module->error('err_ip_timeout');
     }
     $options = $byEmail === true ? GWF_User::MAIL_APPROVED : 0;
     $username = $row->getVar('username');
     $countryid = $row->getVar('countryid');
     $user = new GWF_User(array('user_id' => 0, 'user_options' => $options, 'user_name' => $username, 'user_password' => $row->getVar('password'), 'user_regdate' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'user_regip' => $row->getVar('ip'), 'user_email' => $row->getVar('email'), 'user_gender' => 'no_gender', 'user_lastlogin' => 0, 'user_lastactivity' => time(), 'user_birthdate' => $row->getVar('birthdate'), 'user_avatar_v' => 0, 'user_countryid' => $countryid, 'user_langid' => GWF_LangMap::getPrimaryLangID($countryid), 'user_langid2' => 0, 'user_level' => 0, 'user_title' => '', 'user_settings' => '', 'user_data' => '', 'user_credits' => '0.00'));
     if (false === $user->insert()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if (false === $ua->deleteWhere(sprintf('username=\'%s\'', $username))) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return self::onActivated($module, $user);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:21,代码来源:Activate.php

示例5: fixWeChallUser

 private static function fixWeChallUser(Module_WeChall $module)
 {
     if (false === ($user = GWF_User::getByName('WeChall'))) {
         $user = new GWF_User(array('user_name' => 'WeChall', 'user_email' => 'wechall@wechall.net', 'user_password' => GWF_Password::hashPasswordS('wechallbot'), 'user_regdate' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'user_regip' => GWF_IP6::getIP(GWF_IP_EXACT, '127.0.0.1'), 'user_lastactivity' => time(), 'user_options' => GWF_User::BOT));
         if (false === $user->insert()) {
             echo GWF_HTML::error('WeChall Install', 'Can not find user WeChall');
             $uid = 0;
         } else {
             $uid = $user->getID();
         }
     } else {
         $uid = $user->getID();
     }
     if (false === $module->saveModuleVar('wc_uid', $uid)) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return '';
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:18,代码来源:GWF_WeChallInstall.php

示例6: createAdmin

 public static function createAdmin($username, $password, $email, &$output)
 {
     if (false === ($user = GWF_User::getByName($username))) {
         $user = new GWF_User(array('user_name' => $username, 'user_email' => $email, 'user_password' => GWF_Password::hashPasswordS($password), 'user_regdate' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'user_regip' => GWF_IP6::getIP(GWF_IP_EXACT), 'user_lastactivity' => time()));
         if (false === $user->insert()) {
             return false;
         }
     }
     $userid = $user->getID();
     if (false === GWF_UserGroup::addToGroup($userid, GWF_Group::getByName(GWF_Group::ADMIN)->getID())) {
         return false;
     }
     if (false === GWF_UserGroup::addToGroup($userid, GWF_Group::getByName(GWF_Group::STAFF)->getID())) {
         return false;
     }
     $output .= GWF_HTML::message('Install Wizard', sprintf('Added new admin user: %s - Password: [censored]', $username));
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:18,代码来源:GWF_InstallFunctions.php

示例7: htmlSendToLogin

require 'key2.key';
$key2 = ob_get_contents();
ob_end_clean();
chdir("../../../");
require_once "challenge/html_head.php";
$title = '2013 New Years Special';
html_head("Install: {$title}");
if (!GWF_User::isAdminS()) {
    return htmlSendToLogin("Better be admin !");
}
$solution = false;
$score = 4;
$url = "challenge/quangntenemy/2013NYS/index.php";
$creators = "quangntenemy";
$tags = 'Special,Crypto';
WC_Challenge::installChallenge($title, $solution, $score, $url, $creators, $tags, true, WC_Challenge::CHALL_CASE_I);
if (!($user = GWF_User::getByName('Rudolph2013'))) {
    $user = new GWF_User(array('user_id' => '0', 'user_options' => GWF_User::BOT | GWF_User::MAIL_APPROVED | GWF_User::EMAIL_GPG, 'user_name' => 'Rudolph2013', 'user_password' => GWF_Password::hashPasswordS('quangster'), 'user_regdate' => GWF_Time::getDate(), 'user_email' => 'rudolph2013@gizmore.org'));
    $user->insert();
} else {
    $user->saveOption(GWF_User::EMAIL_GPG, true);
}
GWF_PublicKey::updateKey($user->getID(), $key1);
if (!($user = GWF_User::getByName('Silvester2013'))) {
    $user = new GWF_User(array('user_id' => '0', 'user_options' => GWF_User::BOT | GWF_User::MAIL_APPROVED | GWF_User::EMAIL_GPG, 'user_name' => 'Silvester2013', 'user_password' => GWF_Password::hashPasswordS('quangster'), 'user_regdate' => GWF_Time::getDate(), 'user_email' => 'silvester2013@gizmore.org'));
    $user->insert();
} else {
    $user->saveOption(GWF_User::EMAIL_GPG, true);
}
GWF_PublicKey::updateKey($user->getID(), $key2);
require_once "challenge/html_foot.php";
开发者ID:sinfocol,项目名称:gwf3,代码行数:31,代码来源:install.php


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