Example #1
0
function admin($message = '')
{
    global $myprivs, $txp_user;
    pagetop(gTxt('site_administration'), $message);
    $themail = fetch('email', 'txp_users', 'name', $txp_user);
    echo new_pass_form();
    echo change_email_form($themail);
    echo author_list();
    echo $myprivs == 1 ? new_author_form() : '';
}
Example #2
0
function admin($message = '')
{
    global $txp_user;
    pagetop(gTxt('site_administration'), $message);
    if (!is_callable('mail')) {
        echo tag(gTxt('warn_mail_unavailable'), 'p', ' id="warning" ');
    }
    $email = fetch('email', 'txp_users', 'name', $txp_user);
    echo new_pass_form() . change_email_form($email);
    if (has_privs('admin.list')) {
        echo author_list();
    }
    if (has_privs('admin.edit')) {
        echo new_author_form() . reset_author_pass_form();
    }
}
Example #3
0
function admin($message = '')
{
    global $txp_user;
    pagetop(gTxt('site_administration'), $message);
    $themail = fetch('email', 'txp_users', 'name', $txp_user);
    echo new_pass_form();
    echo change_email_form($themail);
    if (has_privs('admin.list')) {
        echo author_list();
    }
    if (has_privs('admin.edit')) {
        echo new_author_form();
    }
    if (has_privs('admin.edit')) {
        echo reset_author_pass_form();
    }
}
Example #4
0
function author_edit($message = '')
{
    global $txp_user;
    pagetop(gTxt('site_administration'), $message);
    if (is_disabled('mail')) {
        echo tag(gTxt('warn_mail_unavailable'), 'p', ' id="warning" ');
    }
    $email = fetch('email', 'txp_users', 'name', $txp_user);
    echo n . '<div id="users_container" class="txp-container">';
    if (has_privs('admin.edit')) {
        echo n . '<div class="txp-edit">' . author_form() . '</div>';
    }
    if (has_privs('admin.list')) {
        echo author_list();
    }
    echo new_pass_form();
    if (!has_privs('admin.edit')) {
        echo change_email_form($email);
    }
    echo n . '</div>';
}
Example #5
0
/**
 * Changes current user's password.
 */
function change_pass()
{
    global $txp_user;
    extract(psa(array('current_pass', 'new_pass')));
    if (empty($new_pass)) {
        new_pass_form(array(gTxt('password_required'), E_ERROR));
        return;
    }
    if (txp_validate($txp_user, $current_pass)) {
        $rs = change_user_password($txp_user, $new_pass);
        if ($rs) {
            $message = gTxt('password_changed');
            author_list($message);
        }
    } else {
        new_pass_form(array(gTxt('password_invalid'), E_ERROR));
    }
}