Example #1
0
<?php

system\Helper::arcAddFooter("js", system\Helper::arcGetModulePath() . "js/pagepermissions.js");
Example #2
0
    // end ldap
    $user = \User::getByEmail($_POST["email"]);
    if ($user->verifyPassword($_POST["password"])) {
        if ($user->enabled) {
            doLogin($user);
            return;
        } else {
            system\Helper::arcAddMessage("danger", "Account disabled");
            Log::createLog("danger", "user", "Attempt to access disabled account: " . $_POST["email"]);
            return;
        }
    }
    system\Helper::arcAddMessage("danger", "Invalid username and/or password");
    Log::createLog("warning", "user", "Incorrect password: "******"email"]);
} else {
    return system\Helper::arcAddFooter("js", system\Helper::arcGetModulePath() . "js/login.js");
}
function doLogin($user)
{
    system\Helper::arcSetUser($user);
    Log::createLog("success", "user", "User logged in: " . $user->email);
    system\Helper::arcCheckSettingExists("ARC_LOGIN_URL", "/");
    $url = SystemSetting::getByKey("ARC_LOGIN_URL");
    system\Helper::arcReturnJSON(["redirect" => $url->value]);
    system\Helper::arcAddMessage("success", "Login successful.");
}
function LDAPLogin($server = "mydomain.local", $username, $password, $domain = "mydomain", $dc = "dc=mydomain,dc=local")
{
    // https://www.exchangecore.com/blog/how-use-ldap-active-directory-authentication-php/
    $ldap = ldap_connect("ldap://{$server}");
    $ldaprdn = "{$domain}\\{$username}";
Example #3
0
<?php

if (system\Helper::arcIsAjaxRequest()) {
    $user = system\Helper::arcGetUser();
    // password settings
    if (!empty($_POST["password"])) {
        if (strlen($_POST["password"]) > 0 && $_POST["password"] == $_POST["password2"]) {
            $user->setPassword($_POST['password']);
        } else {
            system\Helper::arcAddMessage("danger", "Password and retyped password do not match");
            return;
        }
    }
    $user->firstname = ucfirst(strtolower($_POST["firstname"]));
    $user->lastname = ucfirst(strtolower($_POST["lastname"]));
    $user->update();
    system\Helper::arcSetUser($user);
    system\Helper::arcAddMessage("success", "Changes saved");
} else {
    system\Helper::arcAddFooter("js", system\Helper::arcGetModulePath() . "js/userdetails.js");
}
Example #4
0
<?php

system\Helper::arcAddFooter("js", system\Helper::arcGetModulePath() . "js/mediamanager.js");
Example #5
0
<?php

system\Helper::arcAddFooter("js", system\Helper::arcGetModulePath() . "js/logviewer.js");
Example #6
0
<?php

system\Helper::arcAddFooter("js", system\Helper::arcGetModulePath() . "js/systemsettings.js");
$logs = SystemSetting::getByKey("ARC_KEEP_LOGS");
$file_size = SystemSetting::getByKey("ARC_FILE_UPLOAD_SIZE_BYTES");
$theme_setting = SystemSetting::getByKey("ARC_THEME");
$thumb = SystemSetting::getByKey("ARC_THUMB_WIDTH");
$login_url = SystemSetting::getByKey("ARC_LOGIN_URL");
$default_page = SystemSetting::getByKey("ARC_DEFAULT_PAGE");
$mail = SystemSetting::getByKey("ARC_MAIL");
$ldap = SystemSetting::getByKey("ARC_LDAP");
$reg = \SystemSetting::getByKey("ARC_ALLOWREG");
$logo = \SystemSetting::getByKey("ARC_LOGO_PATH");
$dateformat = \SystemSetting::getByKey("ARC_DATEFORMAT");
$timeformat = \SystemSetting::getByKey("ARC_TIMEFORMAT");
$company = \SystemSetting::getByKey("ARC_REQUIRECOMPANY");
$title = \SystemSetting::getByKey("ARC_SITETITLE");
$media = \SystemSetting::getByKey("ARC_MEDIAMANAGERURL");
Example #7
0
        system\Helper::arcAddMessage("danger", "User already exists with that email address");
        return;
    }
    $user->firstname = ucfirst(strtolower($_POST["firstname"]));
    $user->lastname = ucfirst(strtolower($_POST["lastname"]));
    $user->email = strtolower($_POST["emailr"]);
    if (empty($user->email)) {
        system\Helper::arcAddMessage("danger", "Please specifiy an email address");
        return;
    }
    $user->setPassword($_POST["passwordr"]);
    // save user
    $user->update();
    $company = SystemSetting::getByKey("ARC_REQUIRECOMPANY");
    if (!empty($_POST["company"]) && $company->value == "true") {
        $comp = Company::getByName(ucwords($_POST["company"]));
        if ($comp->id == 0) {
            $comp = new Company();
            $comp->name = ucwords($_POST["company"]);
            $comp->update();
        }
        $user->addToCompany($comp->id);
    }
    system\Helper::arcSetUser($user);
    system\Helper::arcAddMessage("success", "Your details have been registered");
    system\Helper::arcCheckSettingExists("ARC_LOGIN_URL", "/");
    $url = SystemSetting::getByKey("ARC_LOGIN_URL");
    system\Helper::arcReturnJSON(["redirect" => $url->value]);
} else {
    system\Helper::arcAddFooter("js", system\Helper::arcGetModulePath() . "js/register.js");
}