Exemple #1
0
<?php

set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');
include_once 'aur.inc.php';
# access AUR common functions
include_once 'acctfuncs.inc.php';
# access Account specific functions
set_lang();
# this sets up the visitor's language
check_sid();
# see if they're still logged in
if (isset($_COOKIE["AURSID"])) {
    header('Location: /');
    exit;
}
html_header(__('Register'));
echo '<div class="box">';
echo '<h2>' . __('Register') . '</h2>';
if (in_request("Action") == "NewAccount") {
    list($success, $message) = process_account_form("new", "NewAccount", in_request("U"), 1, 0, in_request("E"), in_request("H"), '', '', in_request("R"), in_request("L"), in_request("I"), in_request("K"), in_request("PK"));
    print $message;
    if (!$success) {
        display_account_form("NewAccount", in_request("U"), 1, 0, in_request("E"), in_request("H"), '', '', in_request("R"), in_request("L"), in_request("I"), in_request("K"), in_request("PK"));
    }
} else {
    print '<p>' . __("Use this form to create an account.") . '</p>';
    display_account_form("NewAccount", "", "", "", "", "", "", "", "", $LANG);
}
echo '</div>';
html_footer(AURWEB_VERSION);
Exemple #2
0
            } else {
                $row = mysql_fetch_assoc($result);
                # don't need to check if they have permissions, this is a
                # normal user editing themselves.
                #
                print __("Use this form to update your account.");
                print "<br />";
                print __("Leave the password fields blank to keep your same password.");
                display_account_form($atype, "UpdateAccount", $row["Username"], $row["AccountType"], $row["Suspended"], $row["Email"], "", "", $row["RealName"], $row["LangPreference"], $row["IRCNick"], $row["NewPkgNotify"], $row["ID"]);
            }
        }
    }
} else {
    # visitor is not logged in
    #
    if ($_REQUEST["Action"] == "AccountInfo") {
        print __("You must log in to view user information.");
    } elseif ($_REQUEST["Action"] == "NewAccount") {
        # process the form input for creating a new account
        #
        process_account_form("", "new", "NewAccount", $_REQUEST["U"], 1, 0, $_REQUEST["E"], $_REQUEST["P"], $_REQUEST["C"], $_REQUEST["R"], $_REQUEST["L"], $_REQUEST["I"], $_REQUEST["N"]);
    } else {
        # display the account request form
        #
        print __("Use this form to create an account.");
        display_account_form("", "NewAccount");
    }
}
echo "  </div>";
echo "</div>";
html_footer(AUR_VERSION);
Exemple #3
0
$need_userinfo = array("DisplayAccount", "DeleteAccount", "AccountInfo", "UpdateAccount");
if (in_array($action, $need_userinfo)) {
    $row = account_details(in_request("ID"), in_request("U"));
    $PK = implode("\n", account_get_ssh_keys($row["ID"]));
}
/* This has to be done before the navigation headers are written,
 * because html_header() fetches the current username from the database,
 * which could be changed by process_account_form()
 */
if ($action == "UpdateAccount") {
    $update_account_message = '';
    /* Details for account being updated */
    /* Verify user permissions and that the request is a valid POST */
    if (can_edit_account($row) && check_token()) {
        /* Update the details for the existing account */
        list($success, $update_account_message) = process_account_form("edit", "UpdateAccount", in_request("U"), in_request("T"), in_request("S"), in_request("E"), in_request("H"), in_request("P"), in_request("C"), in_request("R"), in_request("L"), in_request("I"), in_request("K"), in_request("PK"), in_request("J"), in_request("ID"), $row["Username"]);
    }
}
if ($action == "AccountInfo") {
    html_header(__('Account') . ' ' . $row['Username']);
} else {
    html_header(__('Accounts'));
}
# Main page processing here
#
echo "<div class=\"box\">\n";
echo "  <h2>" . __("Accounts") . "</h2>\n";
if (isset($_COOKIE["AURSID"])) {
    if ($action == "SearchAccounts") {
        # security check
        #