本文整理汇总了PHP中admin_tools::EditingValue方法的典型用法代码示例。如果您正苦于以下问题:PHP admin_tools::EditingValue方法的具体用法?PHP admin_tools::EditingValue怎么用?PHP admin_tools::EditingValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin_tools
的用法示例。
在下文中一共展示了admin_tools::EditingValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
function create(&$user_info, $username)
{
global $dataDir, $langmessage;
//update the session files to .php files
//changes to $userinfo will be saved by UpdateAttempts() below
$user_info = gpsession::SetSessionFileName($user_info, $username);
$user_file_name = $user_info['file_name'];
$user_file = $dataDir . '/data/_sessions/' . $user_file_name;
//use an existing session_id if the new login matches an existing session (uid and file_name)
$sessions = gpsession::GetSessionIds();
$uid = gpsession::auth_browseruid();
$session_id = false;
foreach ($sessions as $sess_temp_id => $sess_temp_info) {
if (isset($sess_temp_info['uid']) && $sess_temp_info['uid'] == $uid && $sess_temp_info['file_name'] == $user_file_name) {
$session_id = $sess_temp_id;
}
}
//create a unique session id if needed
if ($session_id === false) {
do {
$session_id = common::RandomString(40);
} while (isset($sessions[$session_id]));
}
$expires = !isset($_POST['remember']);
gpsession::cookie(gp_session_cookie, $session_id, $expires);
//save session id
$sessions[$session_id] = array();
$sessions[$session_id]['file_name'] = $user_file_name;
$sessions[$session_id]['uid'] = $uid;
//$sessions[$session_id]['time'] = time(); //for session locking
if (!gpsession::SaveSessionIds($sessions)) {
return false;
}
//make sure the user's file exists
$new_data = gpsession::SessionData($user_file, $checksum);
$new_data['username'] = $username;
$new_data['granted'] = $user_info['granted'];
admin_tools::EditingValue($new_data);
gpFiles::SaveArray($user_file, 'gpAdmin', $new_data);
return $session_id;
}
示例2: GetUsers
function GetUsers()
{
$this->users = gpFiles::Get('_site/users');
//fix the editing value
foreach ($this->users as $username => $userinfo) {
$userinfo += array('granted' => '');
admin_tools::EditingValue($userinfo);
$this->users[$username] = $userinfo;
}
}
示例3: GetUsers
function GetUsers()
{
global $dataDir;
require $dataDir . '/data/_site/users.php';
$this->users = $users;
//fix the editing value
foreach ($this->users as $username => $userinfo) {
$userinfo += array('granted' => '');
admin_tools::EditingValue($userinfo);
$this->users[$username] = $userinfo;
}
}