Example #1
0
function uimport_post(&$a)
{
    switch ($a->config['register_policy']) {
        case REGISTER_OPEN:
            $blocked = 0;
            $verified = 1;
            break;
        case REGISTER_APPROVE:
            $blocked = 1;
            $verified = 0;
            break;
        default:
        case REGISTER_CLOSED:
            if (!x($_SESSION, 'authenticated') && !x($_SESSION, 'administrator')) {
                notice(t('Permission denied.') . EOL);
                return;
            }
            $blocked = 1;
            $verified = 0;
            break;
    }
    if (x($_FILES, 'accountfile')) {
        // TODO: pass $blocked / $verified, send email to admin on REGISTER_APPROVE
        import_account($a, $_FILES['accountfile']);
        return;
    }
}
function migrator_import_identity(&$a, $email)
{
    $found_id = get_account_by_email($email);
    if (!$found_id) {
        json_error_die(404, 'Not Found', 'No such account ' . $email);
    }
    $res = import_account($a, $found_id);
    json_return_and_die(array("status" => 'OK', 'result' => $res, 'files' => $_FILES, 'email' => $email));
}
Example #3
0
function import_post(&$a)
{
    $account_id = get_account_id();
    if (!$account_id) {
        return;
    }
    import_account($a, $account_id);
}