📄 edit_user.php
字号:
<?php/* Copyright Intermesh 2003 Author: Merijn Schering <mschering@intermesh.nl> Version: 1.0 Release date: 08 July 2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */require_once("../../Group-Office.php");require_once($GO_LANGUAGE->get_language_file('users'));//require_once($GO_LANGUAGE->get_base_language_file('common'));$GO_SECURITY->authenticate();$GO_MODULES->authenticate('users');$user_id = isset($_REQUEST['user_id']) ? $_REQUEST['user_id'] : 0;$return_to = (isset($_REQUEST['return_to']) && $_REQUEST['return_to'] != '') ? $_REQUEST['return_to'] : $_SERVER['HTTP_REFERER'];$user = $GO_USERS->get_user($user_id);if (!$user){ $feedback = $strDataError;}if ($_SERVER['REQUEST_METHOD'] == "POST"){ if($_POST['pass1'] != '') { $user['password'] = md5(smart_stripslashes($_POST['pass1'])); } //translate the given birthdayto gmt unix time $user['birthday'] = date_to_db_date(smart_addslashes($_POST['birthday'])); $user['first_name'] = smart_addslashes(trim($_POST['first_name'])); $user['middle_name'] = smart_addslashes(trim($_POST['middle_name'])); $user['last_name'] = smart_addslashes(trim($_POST['last_name'])); $user['initials'] = smart_addslashes($_POST["initials"]); $user['title'] = smart_addslashes($_POST["title"]); $user['email'] = smart_addslashes($_POST["email"]); $user['work_phone'] = smart_addslashes($_POST["work_phone"]); $user['home_phone'] = smart_addslashes($_POST["home_phone"]); $user['fax'] = smart_addslashes($_POST["fax"]); $user['cellular'] = smart_addslashes($_POST["cellular"]); $user['country_id'] = smart_addslashes($_POST["country_id"]); $user['state'] = smart_addslashes($_POST["state"]); $user['city'] = smart_addslashes($_POST["city"]); $user['zip'] = smart_addslashes($_POST["zip"]); $user['address'] = smart_addslashes($_POST["address"]); $user['department'] = smart_addslashes($_POST["department"]); $user['function'] = smart_addslashes($_POST["function"]); $user['company'] = smart_addslashes($_POST["company"]); $user['work_country_id'] = smart_addslashes($_POST["work_country_id"]); $user['work_state'] = smart_addslashes($_POST["work_state"]); $user['work_city'] = smart_addslashes($_POST["work_city"]); $user['work_zip'] = smart_addslashes($_POST["work_zip"]); $user['work_address'] = smart_addslashes($_POST["work_address"]); $user['work_fax'] = smart_addslashes($_POST["work_fax"]); $user['homepage'] = smart_addslashes($_POST["homepage"]); $user['enabled'] = isset($_POST["enabled"]) ? '1' : '0'; $user['language'] = isset($_POST['language']) ? smart_stripslashes($_POST['language']) : $GO_CONFIG->language; $user['theme'] = isset($_POST['theme']) ? smart_stripslashes($_POST['theme']) : $GO_CONFIG->theme; $user['sex'] = $_POST['sex']; $user['id'] = $user_id; $existing_email_user = $GO_USERS->get_user_by_email($user['email']); if ($_POST['pass1'] != $_POST['pass2']) { $feedback = $error_match_pass; }elseif ( empty($user['first_name']) || empty($user['last_name']) ) { $feedback = $error_missing_field; }elseif(!validate_email($user['email'])) { $feedback = $error_email; }elseif($existing_email_user && $existing_email_user['id'] != $user_id) { $feedback = $error_email_exists; }else { $user_groups = isset($_POST['user_groups']) ? $_POST['user_groups'] : array(); $modules_read = isset($_POST['modules_read']) ? $_POST['modules_read'] : array(); $modules_write = isset($_POST['modules_write']) ? $_POST['modules_write'] : array(); $visible_user_groups = isset($_POST['visible_user_groups']) ? $_POST['visible_user_groups'] : array(); if (!$GO_USERS->update_user($user, $user_groups, $visible_user_groups, $modules_read, $modules_write)) { $feedback = $strSaveError; }elseif ($_POST['close'] == 'true' && !isset($feedback)) { header('Location: '.$return_to); exit(); } }}$user['birthday'] = db_date_to_date($user['birthday']);$birthday_picker = new date_picker('birthday', $_SESSION['GO_SESSION']['date_format'], $user['birthday']);$GO_HEADER['head'] = $birthday_picker ->get_header();$page_title = $menu_users;require_once($GO_THEME->theme_path."header.inc");require('register_form.inc');require_once($GO_THEME->theme_path."footer.inc");?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -