$val ) { //Clean the junk $args[$key] = urldecode(filter_var( $val, FILTER_SANITIZE_ENCODED, FILTER_SANITIZE_SPECIAL_CHARS )); } $loginMsg = "Unknown Error"; if( $_SERVER['REQUEST_METHOD'] === 'POST' ) { require_once "tCMS/Auth.inc"; //Authenticate $auth = new Auth; $login = $auth->do_auth( $args['username'], $args['password'] ); if(!is_array($login) || !empty($login['err']) || empty( $login['success'] ) ) { $loginFailure = 1; if( !empty( $login['msg'] ) ) $loginMsg = $login['msg']; http_response_code(401); } else { # We succeeded $loginMsg = "Login Succeded, redirecting..."; $loginFailure = 0; } } } # Construct the redirection URL if( empty( $args['to'] ) ) { $redir = 'index.php'; } else { $redir = 'index.php?app=' . $args["to"]; } $redirection_URL = "https://" . $_SERVER["SERVER_NAME"] . "/sys/admin/$redir"; ?> tCMS 2 ~ Login
Please enable JavaScript on this domain.
CMS Login

Username

Password