Пример #1
0
 */
$tab = sumo_get_user_info($_GET['id'], 'id', false);
if (sumo_verify_permissions(4, $tab['group'], null, false) || sumo_verify_permissions(false, false, $tab['username'], false) || $SUMO['user']['id'] == $tab['owner_id']) {
    $tpl['PUT:NewPassword'] = $tpl['PUT:NewPassword'] ? $tpl['PUT:NewPassword'] : '';
    $tpl['PUT:ReNewPassword'] = $tpl['PUT:ReNewPassword'] ? $tpl['PUT:ReNewPassword'] : '';
    // If id not exist
    if (!$tab['username']) {
        $tpl['MESSAGE:H'] = sumo_get_message('W00001C', $_GET['id']);
    }
    // get data source of user
    $datasource = sumo_get_datasource_info($tab['datasource_id']);
    $tpl['PUT:Status'] = "";
    $tpl['PUT:GroupLevel'] = sumo_put_user_grouplevel($_GET['id']);
    $tpl['PUT:AddGroupLevel'] = $tab['username'] == 'sumo' ? "<input type='hidden' name='newgroup' value='sumo:7'>" : sumo_add_user_grouplevel('ModifyUsers', sumo_get_grouplevel($tab['usergroup'], true));
    $tpl['BUTTON:AddGroup'] = $tab['username'] == 'sumo' ? "" : "<input type='submit' class='button' value='" . $language['AddGroup'] . "'>";
    $tpl['PUT:DataSourceType'] = ($tab['username'] == 'sumo' || $tab['username'] == $SUMO['user']['user']) && $SUMO['user']['id'] != $tab['owner_id'] ? "<input name='datasource_id' type='hidden' value='" . $datasource['id'] . "'>" . $datasource['name'] : sumo_put_datasource($datasource['id']);
    $tpl['GET:LastLogin'] = sumo_get_human_date($tab['last_login']);
    $tpl['GET:PwdUpdated'] = sumo_get_human_date($tab['pwd_updated']);
    $tpl['GET:AccountCreated'] = sumo_get_human_date($tab['created']);
    $tpl['GET:Modified'] = sumo_get_human_date($tab['modified']);
    $tpl['GET:UserAccessPages'] = sumo_get_user_accesspoints($tab['id'], true);
    $tpl['GET:UpdateForm'] = sumo_get_form_req('', 'modify', 'id=' . $tab['id'], 'POST', ' enctype="multipart/form-data"');
    $tpl['GET:Expire'] = $tab['day_limit'] ? sumo_get_human_date($tab['day_limit'] * 86400 + $SUMO['server']['time'], false) : $language['Never'];
    $tpl['GET:User'] = $tab['username'] . "<input type='hidden' name='user' value='" . $tab['username'] . "'>";
    $tpl['IMG:User'] = "******" . $tab['id'] . "' alt='" . $tab['username'] . "' class='user'>";
    $tpl['IMG:Language'] = "<img src='themes/" . $SUMO['page']['theme'] . "/images/flags/" . $tab['language'] . ".png' alt='" . ucwords(sumo_get_string_languages($tab['language'])) . "' class='flag' id='userflag'>";
    $tpl['LINK:AddUser'] = sumo_get_action_icon("users", "new", "users.content", "?module=users&action=new&decoration=false");
    $tpl['LINK:EditUser'] = sumo_get_action_icon("users", "edit");
    // Verify image support for refection effects
    if (function_exists('imagecreatefromjpeg') && function_exists('imagecreatefrompng') && function_exists('imagecreatefromgif')) {
        $tpl['IMG:User'] . "<br><img src='services.php?module=users&service=image&cmd=GET_USER_REFLECTION&id=" . $tab['id'] . "&fade=6&height=30%'>";
Пример #2
0
 * @copyright  Copyright &copy; 2003-2009, Alberto Basso
 * @package    SUMO
 * @category   Console
 */
if (sumo_verify_permissions(5, $SUMO['user']['group'])) {
    $tpl['PUT:User'] = "******" . $_POST['user'] . "'>";
    $tpl['PUT:FirstName'] = "<input type='text' size='35' name='firstname' value='" . htmlspecialchars($_POST['firstname'], ENT_QUOTES) . "'>";
    $tpl['PUT:LastName'] = "<input type='text' size='35' name='lastname' value='" . htmlspecialchars($_POST['lastname'], ENT_QUOTES) . "'>";
    $tpl['PUT:Email'] = "<input type='text' size='35' name='email' value='" . $_POST['email'] . "'>";
    $tpl['PUT:DayLimit'] = "<input type='text' size='3' name='day_limit' value='" . $SUMO['config']['accounts']['life'] . "'>";
    $tpl['PUT:NewPassword'] = "******";
    $tpl['PUT:ReNewPassword'] = "******";
    $tpl['PUT:IP'] = "<textarea rows='2' cols='40' name='ip'>" . $_POST['ip'] . "</textarea>";
    $tpl['PUT:AddGroupLevel'] = sumo_add_user_grouplevel('AddUsers');
    $tpl['PUT:Language'] = sumo_get_available_languages(1, 0, $_COOKIE['language']);
    $tpl['PUT:DataSourceType'] = sumo_put_datasource();
    $tpl['GET:AddForm'] = sumo_get_form_req('', 'add', '', 'POST', 'onsubmit=\'if(document.AddUsers.new_password.value!=""){document.AddUsers.new_password.value=hex_sha1(document.AddUsers.new_password.value);' . 'document.AddUsers.renew_password.value=hex_sha1(document.AddUsers.renew_password.value);}\'');
    // Status
    $tpl['GET:Status'] = "<font class='status-green'>" . $language['Active'] . "</font>";
    $tpl['IMG:Status'] = "<img src='themes/" . $SUMO['page']['theme'] . "/images/modules/users/user_on.gif' align='middle'>";
    $tpl['PUT:Status'] = "<select name='active'>\n<option value='1'>" . $language['Enable'] . "</option>\n<option value='0'>" . $language['Disable'] . "</option>\n</select>";
    // Pwd expiration date
    if ($SUMO['config']['accounts']['password']['life'] > 0) {
        $tpl['GET:PwdExpiration'] = sumo_get_human_date($SUMO['server']['time'] + $SUMO['config']['accounts']['password']['life'] * 86400);
    }
    $tpl['LINK:AddUser'] = sumo_get_action_icon("users", "new");
    $tpl['LINK:EditUser'] = sumo_get_action_icon("users", "edit");
    $tpl['LINK:Remove'] = sumo_get_action_icon("users", "delete");
} else {
    $action_error = true;
    $tpl['MESSAGE:H'] = $language['AccessDenied'];