SproutCMS

This is the code documentation for the SproutCMS project

class Auth

Provides user authentication functions for the admin

Source code (93 results)

/config/sprout.php   Highlighted file source

Line 55: * smtp_auth Boolean to enable authentication
Line 56: * smtp_username Authentication username
Line 57: * smtp_password Authentication password
Line 63: $config['smtp_auth'] = false;
Line 87: * Proxy auth, formatted as user:password
Line 89: $config['httpreq_proxy_auth'] = '';
Line 296: * Per-hour rate limiting for admin authentication
Line 298: $config['auth_rate_limit']['ip'] = 10;
Line 299: $config['auth_rate_limit']['username'] = 10;

/config/sprout.php   Highlighted file source

Line 55: * smtp_auth Boolean to enable authentication
Line 56: * smtp_username Authentication username
Line 57: * smtp_password Authentication password
Line 63: $config['smtp_auth'] = false;
Line 87: * Proxy auth, formatted as user:password
Line 89: $config['httpreq_proxy_auth'] = '';
Line 296: * Per-hour rate limiting for admin authentication
Line 298: $config['auth_rate_limit']['ip'] = 10;
Line 299: $config['auth_rate_limit']['username'] = 10;

/modules/Demo/Controllers/Admin/DemoItemAdminController.php   Highlighted file source

Line 19: use Sprout\Helpers\AdminAuth;
Line 145: AdminAuth::checkLogin();
Line 166: AdminAuth::checkLogin();

/modules/HarborAndSprout/config/routes.php   Highlighted file source

Line 4: $config['google-drive/auth-connect'] = $ns . 'HarborController/googleAuthConnect';
Line 5: $config['google-drive/auth-action'] = $ns . 'HarborController/googleAuthAction';

/modules/HarborAndSprout/Controllers/HarborController.php   Highlighted file source

Line 9: use Sprout\Helpers\AdminAuth;
Line 71: * Render Google OAuth form
Line 75: public function googleAuthConnect()
Line 77: AdminAuth::checkLogin();
Line 78: GoogleDriveApi::requestOauthCode();
Line 83: * Handle Oauth2 callback. Saves Oauth2 token
Line 87: public function googleAuthAction()
Line 89: AdminAuth::checkLogin();
Line 92: Notification::error(sprintf('Authentication error: %s', $_GET['error']));
Line 95: GoogleDriveApi::saveOauthToken($_GET['code']);

/modules/HarborAndSprout/Helpers/GoogleDriveApi.php   Highlighted file source

Line 17: * Loads Oauth2 config
Line 29: * Request an Oauth2 code
Line 33: public static function requestOauthCode()
Line 40: 'redirect_uri' => Sprout::absRoot() . 'google-drive/auth-action',
Line 41: 'scope' => 'https://www.googleapis.com/auth/drive',
Line 46: Url::redirect(sprintf('%s?%s', $config['auth_uri'], http_build_query($params)));
Line 51: * Save Oauth token
Line 53: * @param string $code oAuth2 code
Line 56: public static function saveOauthToken($code)
Line 65: 'redirect_uri' => Sprout::absRoot() . 'google-drive/auth-action',
Line 66: 'grant_type' => 'authorization_code',
Line 95: public static function refreshOauthToken($token)
Line 125: * Load Oauth2 token. May cause a token refresh
Line 137: if ($token_info['expires'] <= time()) $token_info = self::refreshOauthToken($token_info['refresh_token']);
Line 163: 'Authorization' => "Bearer {$token}",

/modules/Welcome/Controllers/WelcomeController.php   Highlighted file source

Line 23: use Sprout\Helpers\AdminAuth;
Line 24: use Sprout\Helpers\Auth;
Line 501: $users = AdminAuth::injectLocalSuperConf($_SESSION['supeop_config']['user'], $_SESSION['supeop_config']['hash'], $_SESSION['supeop_config']['salt']);
Line 590: $hashed = Auth::hashPassword($_POST['password1'], Constants::PASSWORD_BCRYPT12);
Line 606: $users = AdminAuth::injectLocalSuperConf($_GET['user'], $_GET['hash'], $_GET['salt']);

/skin/default/partials/_google_analytics.php   Highlighted file source

Line 2: use Sprout\Helpers\AdminAuth;
Line 12: } else if (!$analytics_id or AdminAuth::isLoggedIn()) {

/skin/default/partials/_google_analytics.php   Highlighted file source

Line 2: use Sprout\Helpers\AdminAuth;
Line 12: } else if (!$analytics_id or AdminAuth::isLoggedIn()) {

/sprout/config/require_ssl.php   Highlighted file source

Line 6: * @author David Cruz
Line 9: * @Authors_Site http://www.futilemind.com

/sprout/config/require_ssl.php   Highlighted file source

Line 6: * @author David Cruz
Line 9: * @Authors_Site http://www.futilemind.com

/sprout/Controllers/Admin/CategoryAdminController.php   Highlighted file source

Line 19: use Sprout\Helpers\AdminAuth;
Line 434: AdminAuth::checkLogin();
Line 495: AdminAuth::checkLogin();

/sprout/Controllers/Admin/CategoryAdminController.php   Highlighted file source

Line 19: use Sprout\Helpers\AdminAuth;
Line 434: AdminAuth::checkLogin();
Line 495: AdminAuth::checkLogin();

/sprout/Controllers/Admin/CronJobAdminController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 135: AdminAuth::checkLogin();

/sprout/Controllers/Admin/CronJobAdminController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 135: AdminAuth::checkLogin();

/sprout/Controllers/Admin/ExtraPageAdminController.php   Highlighted file source

Line 16: use Sprout\Helpers\AdminAuth;
Line 212: if (!AdminAuth::isSuper()) {

/sprout/Controllers/Admin/ExtraPageAdminController.php   Highlighted file source

Line 16: use Sprout\Helpers\AdminAuth;
Line 212: if (!AdminAuth::isSuper()) {

/sprout/Controllers/Admin/FileAdminController.php   Highlighted file source

Line 24: use Sprout\Helpers\AdminAuth;
Line 81: 'Author' => 'author',
Line 82: 'Show Author' => [new ColModifierBinary(), 'embed_author'],
Line 119: if (!empty($file['type']) and $file['type'] == FileConstants::TYPE_IMAGE) $list['embed_author'] = 'Embed author credit in image';
Line 323: $data['embed_author'] = 1;
Line 427: $update_fields['author'] = @$_POST['author'];
Line 428: $update_fields['embed_author'] = @$_POST['embed_author'] ? 1 : 0;
Line 521: * Matches user input against a list of possible authors for files
Line 524: public function ajaxAuthorLookup()
Line 530: // Check extant author list
Line 533: $conditions[] = ['author', 'CONTAINS', Pdb::likeEscape($term)];
Line 538: $q = "SELECT DISTINCT author
Line 541: ORDER BY author";
Line 776: $valid->check('author', 'Validity::length', 1, 80);
Line 884: // If author (or embed option) has changed, the sizes will need regeneration
Line 886: $file['embed_author'] != (int) @$_POST['embed_author']
Line 888: ((int) @$_POST['embed_author']) and $file['author'] != $_POST['author']
Line 902: $data['author'] = $_POST['author'];
Line 907: $data['embed_author'] = (int) @$_POST['embed_author'];
Line 1052: AdminAuth::checkLogin();
Line 1150: if (AdminAuth::isSuper()) {
Line 1193: AdminAuth::checkLogin();
Line 1505: AdminAuth::checkLogin();

/sprout/Controllers/Admin/FileAdminController.php   Highlighted file source

Line 24: use Sprout\Helpers\AdminAuth;
Line 81: 'Author' => 'author',
Line 82: 'Show Author' => [new ColModifierBinary(), 'embed_author'],
Line 119: if (!empty($file['type']) and $file['type'] == FileConstants::TYPE_IMAGE) $list['embed_author'] = 'Embed author credit in image';
Line 323: $data['embed_author'] = 1;
Line 427: $update_fields['author'] = @$_POST['author'];
Line 428: $update_fields['embed_author'] = @$_POST['embed_author'] ? 1 : 0;
Line 521: * Matches user input against a list of possible authors for files
Line 524: public function ajaxAuthorLookup()
Line 530: // Check extant author list
Line 533: $conditions[] = ['author', 'CONTAINS', Pdb::likeEscape($term)];
Line 538: $q = "SELECT DISTINCT author
Line 541: ORDER BY author";
Line 776: $valid->check('author', 'Validity::length', 1, 80);
Line 884: // If author (or embed option) has changed, the sizes will need regeneration
Line 886: $file['embed_author'] != (int) @$_POST['embed_author']
Line 888: ((int) @$_POST['embed_author']) and $file['author'] != $_POST['author']
Line 902: $data['author'] = $_POST['author'];
Line 907: $data['embed_author'] = (int) @$_POST['embed_author'];
Line 1052: AdminAuth::checkLogin();
Line 1150: if (AdminAuth::isSuper()) {
Line 1193: AdminAuth::checkLogin();
Line 1505: AdminAuth::checkLogin();

/sprout/Controllers/Admin/ListAdminController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 137: AdminAuth::checkLogin();

/sprout/Controllers/Admin/ListAdminController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 137: AdminAuth::checkLogin();

/sprout/Controllers/Admin/ManagedAdminController.php   Highlighted file source

Line 23: use Sprout\Helpers\AdminAuth;
Line 1897: AdminAuth::checkLogin();
Line 1923: AdminAuth::checkLogin();

/sprout/Controllers/Admin/ManagedAdminController.php   Highlighted file source

Line 23: use Sprout\Helpers\AdminAuth;
Line 1897: AdminAuth::checkLogin();
Line 1923: AdminAuth::checkLogin();

/sprout/Controllers/Admin/MySettingsAdminController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 24: use Sprout\Helpers\TwoFactor\GoogleAuthenticator;
Line 53: $tools[] = '<li><a href="admin/extra/my_settings/twoFactor">Setup two-factor auth</a></li>';
Line 67: Form::setData(AdminAuth::getDetails());
Line 93: $result = AdminAuth::checkPassword($_POST['old_password'], AdminAuth::getId());
Line 121: Pdb::update('operators', $data, ['id' => AdminAuth::getId()]);
Line 124: AdminAuth::changePassword($_POST['password1'], AdminAuth::getId());
Line 141: $operator = Pdb::query($q, [AdminAuth::getLocalId()], 'row');
Line 144: $goog = new GoogleAuthenticator();
Line 167: 'title' => 'Two factor authentication',
Line 178: $goog = new GoogleAuthenticator();
Line 190: Pdb::update('operators', $data, ['id' => AdminAuth::getLocalId()]);
Line 193: Notification::confirm('Two factor auth has been enabled');
Line 206: Pdb::update('operators', $data, ['id' => AdminAuth::getLocalId()]);
Line 208: Notification::confirm('Two factor auth has been disabled');

/sprout/Controllers/Admin/MySettingsAdminController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 24: use Sprout\Helpers\TwoFactor\GoogleAuthenticator;
Line 53: $tools[] = '<li><a href="admin/extra/my_settings/twoFactor">Setup two-factor auth</a></li>';
Line 67: Form::setData(AdminAuth::getDetails());
Line 93: $result = AdminAuth::checkPassword($_POST['old_password'], AdminAuth::getId());
Line 121: Pdb::update('operators', $data, ['id' => AdminAuth::getId()]);
Line 124: AdminAuth::changePassword($_POST['password1'], AdminAuth::getId());
Line 141: $operator = Pdb::query($q, [AdminAuth::getLocalId()], 'row');
Line 144: $goog = new GoogleAuthenticator();
Line 167: 'title' => 'Two factor authentication',
Line 178: $goog = new GoogleAuthenticator();
Line 190: Pdb::update('operators', $data, ['id' => AdminAuth::getLocalId()]);
Line 193: Notification::confirm('Two factor auth has been enabled');
Line 206: Pdb::update('operators', $data, ['id' => AdminAuth::getLocalId()]);
Line 208: Notification::confirm('Two factor auth has been disabled');

/sprout/Controllers/Admin/OperatorAdminController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 132: if (!AdminPerms::canEditOperator($item_id) and $item_id != AdminAuth::getId()) {
Line 149: if ($item_id == AdminAuth::getLocalId()) {
Line 247: AdminAuth::changePassword($_POST['password1'], $item_id);
Line 277: if (AdminAuth::hasDatabaseRecord() and $item_id == AdminAuth::getId()) {
Line 302: if (AdminAuth::hasDatabaseRecord() and $item_id == AdminAuth::getId()) {
Line 377: AdminAuth::changePassword($_POST['password1'], $item_id);
Line 405: if ($item_id == AdminAuth::getLocalId()) {

/sprout/Controllers/Admin/OperatorAdminController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 132: if (!AdminPerms::canEditOperator($item_id) and $item_id != AdminAuth::getId()) {
Line 149: if ($item_id == AdminAuth::getLocalId()) {
Line 247: AdminAuth::changePassword($_POST['password1'], $item_id);
Line 277: if (AdminAuth::hasDatabaseRecord() and $item_id == AdminAuth::getId()) {
Line 302: if (AdminAuth::hasDatabaseRecord() and $item_id == AdminAuth::getId()) {
Line 377: AdminAuth::changePassword($_POST['password1'], $item_id);
Line 405: if ($item_id == AdminAuth::getLocalId()) {

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 27: use Sprout\Helpers\AdminAuth;
Line 273: $view->admin_category_options = AdminAuth::getAllCategories();
Line 340: $operator = AdminAuth::getDetails();
Line 475: AdminAuth::checkLogin();
Line 574: AdminAuth::checkLogin();
Line 649: AdminAuth::checkLogin();
Line 669: $operator = AdminAuth::getDetails();
Line 851: $user_id = AdminAuth::getId();
Line 1143: $view->admin_category_options = AdminAuth::getAllCategories();
Line 1228: AdminAuth::checkLogin();
Line 1516: $operator = AdminAuth::getDetails();
Line 1835: AdminAuth::checkLogin();
Line 1894: $operator = AdminAuth::getDetails();
Line 2149: AdminAuth::checkLogin();
Line 2220: AdminAuth::checkLogin();
Line 2302: AdminAuth::checkLogin();
Line 2317: AdminAuth::checkLogin();
Line 2471: if (AdminAuth::isSuper() or Subsites::getConfigAdmin('nav_reorder')) {
Line 2476: if (AdminAuth::isSuper()) {
Line 2506: $details = AdminAuth::getDetails();
Line 2521: AdminAuth::checkLogin();
Line 2734: AdminAuth::checkLogin();

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 27: use Sprout\Helpers\AdminAuth;
Line 273: $view->admin_category_options = AdminAuth::getAllCategories();
Line 340: $operator = AdminAuth::getDetails();
Line 475: AdminAuth::checkLogin();
Line 574: AdminAuth::checkLogin();
Line 649: AdminAuth::checkLogin();
Line 669: $operator = AdminAuth::getDetails();
Line 851: $user_id = AdminAuth::getId();
Line 1143: $view->admin_category_options = AdminAuth::getAllCategories();
Line 1228: AdminAuth::checkLogin();
Line 1516: $operator = AdminAuth::getDetails();
Line 1835: AdminAuth::checkLogin();
Line 1894: $operator = AdminAuth::getDetails();
Line 2149: AdminAuth::checkLogin();
Line 2220: AdminAuth::checkLogin();
Line 2302: AdminAuth::checkLogin();
Line 2317: AdminAuth::checkLogin();
Line 2471: if (AdminAuth::isSuper() or Subsites::getConfigAdmin('nav_reorder')) {
Line 2476: if (AdminAuth::isSuper()) {
Line 2506: $details = AdminAuth::getDetails();
Line 2521: AdminAuth::checkLogin();
Line 2734: AdminAuth::checkLogin();

/sprout/Controllers/Admin/PerRecordPermissionAdminController.php   Highlighted file source

Line 19: use Sprout\Helpers\AdminAuth;
Line 208: $all_cats = AdminAuth::getAllCategories();
Line 209: unset($all_cats[AdminAuth::getPrimaryCategoryId()]);

/sprout/Controllers/Admin/PerRecordPermissionAdminController.php   Highlighted file source

Line 19: use Sprout\Helpers\AdminAuth;
Line 208: $all_cats = AdminAuth::getAllCategories();
Line 209: unset($all_cats[AdminAuth::getPrimaryCategoryId()]);

/sprout/Controllers/Admin/TreeAdminController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 81: if (AdminAuth::isSuper()) {
Line 304: AdminAuth::checkLogin();
Line 415: if (AdminAuth::isSuper()) {

/sprout/Controllers/Admin/TreeAdminController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 81: if (AdminAuth::isSuper()) {
Line 304: AdminAuth::checkLogin();
Line 415: if (AdminAuth::isSuper()) {

/sprout/Controllers/Admin/WorkerJobAdminController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 122: AdminAuth::checkLogin();
Line 170: AdminAuth::checkLogin();

/sprout/Controllers/Admin/WorkerJobAdminController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 122: AdminAuth::checkLogin();
Line 170: AdminAuth::checkLogin();

/sprout/Controllers/AdminAjaxController.php   Highlighted file source

Line 22: use Sprout\Helpers\AdminAuth;
Line 69: AdminAuth::checkLogin();
Line 135: AdminAuth::checkLogin();
Line 163: AdminAuth::checkLogin();
Line 199: AdminAuth::checkLogin();
Line 231: AdminAuth::checkLogin();
Line 239: AdminAuth::checkLogin();
Line 247: AdminAuth::checkLogin();
Line 270: AdminAuth::checkLogin();
Line 312: AdminAuth::checkLogin();
Line 355: AdminAuth::checkLogin();
Line 401: AdminAuth::checkLogin();
Line 414: AdminAuth::checkLogin();
Line 430: AdminAuth::checkLogin();
Line 477: AdminAuth::checkLogin();

/sprout/Controllers/AdminAjaxController.php   Highlighted file source

Line 22: use Sprout\Helpers\AdminAuth;
Line 69: AdminAuth::checkLogin();
Line 135: AdminAuth::checkLogin();
Line 163: AdminAuth::checkLogin();
Line 199: AdminAuth::checkLogin();
Line 231: AdminAuth::checkLogin();
Line 239: AdminAuth::checkLogin();
Line 247: AdminAuth::checkLogin();
Line 270: AdminAuth::checkLogin();
Line 312: AdminAuth::checkLogin();
Line 355: AdminAuth::checkLogin();
Line 401: AdminAuth::checkLogin();
Line 414: AdminAuth::checkLogin();
Line 430: AdminAuth::checkLogin();
Line 477: AdminAuth::checkLogin();

/sprout/Controllers/AdminController.php   Highlighted file source

Line 31: use Sprout\Helpers\AdminAuth;
Line 57: use Sprout\Helpers\TwoFactor\GoogleAuthenticator;
Line 108: // Most methods require auth, but a few do not
Line 109: $methods_no_auth = ['login', 'loginAction', 'loginTwoFactor', 'loginTwoFactorAction', 'logout', 'userAgent'];
Line 111: // Also, some initalisation doesn't work properly when not authenticated
Line 112: if (!in_array(Router::$method, $methods_no_auth) and PHP_SAPI !== 'cli') {
Line 113: AdminAuth::checkLogin();
Line 138: AdminAuth::checkLogin();
Line 147: if (AdminAuth::isLoggedIn()) {
Line 155: $view->admin_authenticated = false;
Line 194: $result = AdminAuth::checkRateLimit($_POST['Username'], Request::userIp());
Line 203: $result = AdminAuth::processLogin($_POST['Username'], $_POST['Password']);
Line 206: $result = AdminAuth::processRemote($_POST['Username'], $_POST['Password']);
Line 210: $result = AdminAuth::processLocal($_POST['Username'], $_POST['Password']);
Line 213: AdminAuth::saveLoginAttempt($_POST['Username'], Request::userIp(), $result === true ? 1 : 0);
Line 220: // Login requires two-factor auth
Line 230: * Show the two-factor-auth ui for a half-logged-in operator
Line 268: * Process the result of a two-factor-auth for a half-logged-in operator
Line 283: $goog = new GoogleAuthenticator();
Line 292: Notification::error('Two-factor authentication failed - please try again');
Line 319: if (!AdminAuth::isSuper()) {
Line 320: $cats = Category::categoryList('operators', AdminAuth::getId());
Line 348: AdminAuth::logout();
Line 364: AdminAuth::checkLogin();
Line 392: AdminAuth::checkLogin();
Line 424: AdminAuth::checkLogin();
Line 429: ['id' => AdminAuth::getId()]
Line 443: AdminAuth::checkLogin();
Line 473: AdminAuth::checkLogin();
Line 510: AdminAuth::checkLogin();
Line 547: AdminAuth::checkLogin();
Line 581: AdminAuth::checkLogin();
Line 615: AdminAuth::checkLogin();
Line 649: AdminAuth::checkLogin();
Line 710: AdminAuth::checkLogin();
Line 754: AdminAuth::checkLogin();
Line 796: AdminAuth::checkLogin();
Line 823: * @return True if auth is okay, false if it is not.
Line 827: AdminAuth::checkLogin();
Line 994: $cat_list = AdminAuth::getAllCategories();
Line 997: $cat_ids = AdminAuth::getOperatorCategories();
Line 1015: $primary_cat_id = AdminAuth::getPrimaryCategoryId();
Line 1024: if (!AdminAuth::inCategory($primary_cat_id)) {
Line 1031: if ($item_id == 0 or AdminAuth::inCategory($primary_cat_id)) {
Line 1036: if (AdminAuth::inCategory($primary_cat_id)) {
Line 1060: AdminAuth::checkLogin();
Line 1176: AdminAuth::checkLogin();
Line 1243: AdminAuth::checkLogin();
Line 1361: AdminAuth::checkLogin();
Line 1424: AdminAuth::checkLogin();
Line 1491: AdminAuth::checkLogin();
Line 1551: AdminAuth::checkLogin();
Line 1663: AdminAuth::checkLogin();
Line 1752: AdminAuth::checkLogin();
Line 1820: AdminAuth::checkLogin();
Line 1882: AdminAuth::checkLogin();
Line 1939: AdminAuth::checkLogin();
Line 1968: AdminAuth::checkLogin();
Line 2015: $view->admin_authenticated = true;
Line 2115: AdminAuth::checkLogin();
Line 2133: AdminAuth::checkLogin();
Line 2182: $op = AdminAuth::getDetails();
Line 2317: AdminAuth::checkLogin();

/sprout/Controllers/AdminController.php   Highlighted file source

Line 31: use Sprout\Helpers\AdminAuth;
Line 57: use Sprout\Helpers\TwoFactor\GoogleAuthenticator;
Line 108: // Most methods require auth, but a few do not
Line 109: $methods_no_auth = ['login', 'loginAction', 'loginTwoFactor', 'loginTwoFactorAction', 'logout', 'userAgent'];
Line 111: // Also, some initalisation doesn't work properly when not authenticated
Line 112: if (!in_array(Router::$method, $methods_no_auth) and PHP_SAPI !== 'cli') {
Line 113: AdminAuth::checkLogin();
Line 138: AdminAuth::checkLogin();
Line 147: if (AdminAuth::isLoggedIn()) {
Line 155: $view->admin_authenticated = false;
Line 194: $result = AdminAuth::checkRateLimit($_POST['Username'], Request::userIp());
Line 203: $result = AdminAuth::processLogin($_POST['Username'], $_POST['Password']);
Line 206: $result = AdminAuth::processRemote($_POST['Username'], $_POST['Password']);
Line 210: $result = AdminAuth::processLocal($_POST['Username'], $_POST['Password']);
Line 213: AdminAuth::saveLoginAttempt($_POST['Username'], Request::userIp(), $result === true ? 1 : 0);
Line 220: // Login requires two-factor auth
Line 230: * Show the two-factor-auth ui for a half-logged-in operator
Line 268: * Process the result of a two-factor-auth for a half-logged-in operator
Line 283: $goog = new GoogleAuthenticator();
Line 292: Notification::error('Two-factor authentication failed - please try again');
Line 319: if (!AdminAuth::isSuper()) {
Line 320: $cats = Category::categoryList('operators', AdminAuth::getId());
Line 348: AdminAuth::logout();
Line 364: AdminAuth::checkLogin();
Line 392: AdminAuth::checkLogin();
Line 424: AdminAuth::checkLogin();
Line 429: ['id' => AdminAuth::getId()]
Line 443: AdminAuth::checkLogin();
Line 473: AdminAuth::checkLogin();
Line 510: AdminAuth::checkLogin();
Line 547: AdminAuth::checkLogin();
Line 581: AdminAuth::checkLogin();
Line 615: AdminAuth::checkLogin();
Line 649: AdminAuth::checkLogin();
Line 710: AdminAuth::checkLogin();
Line 754: AdminAuth::checkLogin();
Line 796: AdminAuth::checkLogin();
Line 823: * @return True if auth is okay, false if it is not.
Line 827: AdminAuth::checkLogin();
Line 994: $cat_list = AdminAuth::getAllCategories();
Line 997: $cat_ids = AdminAuth::getOperatorCategories();
Line 1015: $primary_cat_id = AdminAuth::getPrimaryCategoryId();
Line 1024: if (!AdminAuth::inCategory($primary_cat_id)) {
Line 1031: if ($item_id == 0 or AdminAuth::inCategory($primary_cat_id)) {
Line 1036: if (AdminAuth::inCategory($primary_cat_id)) {
Line 1060: AdminAuth::checkLogin();
Line 1176: AdminAuth::checkLogin();
Line 1243: AdminAuth::checkLogin();
Line 1361: AdminAuth::checkLogin();
Line 1424: AdminAuth::checkLogin();
Line 1491: AdminAuth::checkLogin();
Line 1551: AdminAuth::checkLogin();
Line 1663: AdminAuth::checkLogin();
Line 1752: AdminAuth::checkLogin();
Line 1820: AdminAuth::checkLogin();
Line 1882: AdminAuth::checkLogin();
Line 1939: AdminAuth::checkLogin();
Line 1968: AdminAuth::checkLogin();
Line 2015: $view->admin_authenticated = true;
Line 2115: AdminAuth::checkLogin();
Line 2133: AdminAuth::checkLogin();
Line 2182: $op = AdminAuth::getDetails();
Line 2317: AdminAuth::checkLogin();

/sprout/Controllers/ContentSubscribeController.php   Highlighted file source

Line 20: use Sprout\Helpers\AdminAuth;
Line 316: AdminAuth::checkLogin();

/sprout/Controllers/ContentSubscribeController.php   Highlighted file source

Line 20: use Sprout\Helpers\AdminAuth;
Line 316: AdminAuth::checkLogin();

/sprout/Controllers/Controller.php   Highlighted file source

Line 24: use Sprout\Helpers\AdminAuth;
Line 118: $user_details = AdminAuth::getDetails();

/sprout/Controllers/Controller.php   Highlighted file source

Line 24: use Sprout\Helpers\AdminAuth;
Line 118: $user_details = AdminAuth::getDetails();

/sprout/Controllers/DbToolsController.php   Highlighted file source

Line 32: use Sprout\Helpers\AdminAuth;
Line 34: use Sprout\Helpers\Auth;
Line 110: [ 'url' => 'admin/user-agent', 'name' => 'User agent tool', 'desc' => 'Show browser information<br><span>(this link doesn\'t require auth)</span>' ],
Line 137: // Command-line access does not require auth OR output buffering
Line 140: // Require remote (super) auth
Line 141: AdminAuth::checkLogin();
Line 142: if (AdminAuth::isSuper() !== true) {
Line 707: AdminAuth::checkLogin();
Line 1321: AdminAuth::checkLogin();
Line 1686: if (empty($_POST['module_author'])) {
Line 1687: throw new InvalidArgumentException('Module author not specified');
Line 1935: $_SESSION['module_builder_existing']['field_values']['module_author'] = 'Karmabunny';
Line 1978: if (empty($data['module_author'])) $data['module_author'] = 'Karmabunny';
Line 2011: if (empty($_POST['module_author'])) {
Line 2012: $errs['module_author'] = 'Required';
Line 2235: $text = str_replace('AUTHOR', $_POST['module_author'], $text);
Line 2340: * The username and hash are used by {@see AdminAuth::processLocal}
Line 2363: $data = Auth::hashPassword($_POST['pass'], Constants::PASSWORD_BCRYPT12);
Line 2365: $users = AdminAuth::injectLocalSuperConf($username, $data[0], $data[2]);
Line 2754: $op = AdminAuth::getDetails();
Line 2943: AdminAuth::checkLogin();
Line 2959: AdminAuth::checkLogin();

/sprout/Controllers/DbToolsController.php   Highlighted file source

Line 32: use Sprout\Helpers\AdminAuth;
Line 34: use Sprout\Helpers\Auth;
Line 110: [ 'url' => 'admin/user-agent', 'name' => 'User agent tool', 'desc' => 'Show browser information<br><span>(this link doesn\'t require auth)</span>' ],
Line 137: // Command-line access does not require auth OR output buffering
Line 140: // Require remote (super) auth
Line 141: AdminAuth::checkLogin();
Line 142: if (AdminAuth::isSuper() !== true) {
Line 707: AdminAuth::checkLogin();
Line 1321: AdminAuth::checkLogin();
Line 1686: if (empty($_POST['module_author'])) {
Line 1687: throw new InvalidArgumentException('Module author not specified');
Line 1935: $_SESSION['module_builder_existing']['field_values']['module_author'] = 'Karmabunny';
Line 1978: if (empty($data['module_author'])) $data['module_author'] = 'Karmabunny';
Line 2011: if (empty($_POST['module_author'])) {
Line 2012: $errs['module_author'] = 'Required';
Line 2235: $text = str_replace('AUTHOR', $_POST['module_author'], $text);
Line 2340: * The username and hash are used by {@see AdminAuth::processLocal}
Line 2363: $data = Auth::hashPassword($_POST['pass'], Constants::PASSWORD_BCRYPT12);
Line 2365: $users = AdminAuth::injectLocalSuperConf($username, $data[0], $data[2]);
Line 2754: $op = AdminAuth::getDetails();
Line 2943: AdminAuth::checkLogin();
Line 2959: AdminAuth::checkLogin();

/sprout/Controllers/FileController.php   Highlighted file source

Line 21: use Sprout\Helpers\AdminAuth;
Line 79: // Look up image in DB and see if it needs author attribution
Line 80: $q = "SELECT author, embed_author
Line 86: if (!empty($row['author']) and $row['embed_author']) {
Line 87: $embed_text = $row['author'];
Line 355: AdminAuth::checkLogin();

/sprout/Controllers/FileController.php   Highlighted file source

Line 21: use Sprout\Helpers\AdminAuth;
Line 79: // Look up image in DB and see if it needs author attribution
Line 80: $q = "SELECT author, embed_author
Line 86: if (!empty($row['author']) and $row['embed_author']) {
Line 87: $embed_text = $row['author'];
Line 355: AdminAuth::checkLogin();

/sprout/Controllers/MediaMushController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 34: AdminAuth::checkLogin();

/sprout/Controllers/MediaMushController.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 34: AdminAuth::checkLogin();

/sprout/Controllers/PageController.php   Highlighted file source

Line 22: use Sprout\Helpers\AdminAuth;
Line 170: * @param string $approval_code Code to view the revision without authentication, e.g. via emailed link.
Line 200: AdminAuth::checkLogin();

/sprout/Controllers/PageController.php   Highlighted file source

Line 22: use Sprout\Helpers\AdminAuth;
Line 170: * @param string $approval_code Code to view the revision without authentication, e.g. via emailed link.
Line 200: AdminAuth::checkLogin();

/sprout/Controllers/Tinymce4Controller.php   Highlighted file source

Line 20: use Sprout\Helpers\AdminAuth;
Line 92: AdminAuth::checkLogin();
Line 126: AdminAuth::checkLogin();
Line 164: AdminAuth::checkLogin();
Line 198: AdminAuth::checkLogin();
Line 246: AdminAuth::checkLogin();
Line 277: AdminAuth::checkLogin();
Line 329: AdminAuth::checkLogin();
Line 382: AdminAuth::checkLogin();
Line 416: AdminAuth::checkLogin();
Line 455: AdminAuth::checkLogin();
Line 489: AdminAuth::checkLogin();
Line 528: AdminAuth::checkLogin();

/sprout/Controllers/Tinymce4Controller.php   Highlighted file source

Line 20: use Sprout\Helpers\AdminAuth;
Line 92: AdminAuth::checkLogin();
Line 126: AdminAuth::checkLogin();
Line 164: AdminAuth::checkLogin();
Line 198: AdminAuth::checkLogin();
Line 246: AdminAuth::checkLogin();
Line 277: AdminAuth::checkLogin();
Line 329: AdminAuth::checkLogin();
Line 382: AdminAuth::checkLogin();
Line 416: AdminAuth::checkLogin();
Line 455: AdminAuth::checkLogin();
Line 489: AdminAuth::checkLogin();
Line 528: AdminAuth::checkLogin();

/sprout/Helpers/Admin.php   Highlighted file source

Line 672: if (!AdminAuth::isLoggedIn()) return;
Line 809: $op_id = AdminAuth::getLocalId();
Line 827: $op_id = AdminAuth::getLocalId();
Line 888: $op = AdminAuth::getDetails();

/sprout/Helpers/AdminAuth.php   Highlighted file source

Line 24: * Provides user authentication functions for the admin
Line 26: class AdminAuth extends Auth
Line 106: if (! AdminAuth::checkAlgorithm($admin['algorithm'])) {
Line 139: * For re-authenticating certain actions of logged in operators
Line 218: * @param string $pass_hash The password hash, as generated by {@see Auth::hashPassword}
Line 219: * @param string $pass_salt The password salt, as generated by {@see Auth::hashPassword}
Line 270: // in the case of an authenticated login
Line 323: $rate_limits = Kohana::config('sprout.auth_rate_limit');
Line 409: // Remote-authenticated super-operators
Line 410: // This has not been implemented. See {@see AdminAuth::processRemote} for more info

/sprout/Helpers/AdminDashboard.php   Highlighted file source

Line 53: if (!AdminAuth::hasDatabaseRecord()) {
Line 58: $firstrun = Pdb::query($q, [AdminAuth::getId()], 'val');

/sprout/Helpers/AdminPerms.php   Highlighted file source

Line 85: return array_keys(AdminAuth::getAllCategories());
Line 216: $cats = array_merge($cats, AdminAuth::getOperatorCategories());
Line 221: $admin_id = AdminAuth::getId();
Line 319: $res = Pdb::q($q, [AdminAuth::getId()], 'arr');
Line 374: $res = Pdb::q($q, [AdminAuth::getId()], 'arr');
Line 470: if (! AdminAuth::isLoggedIn()) {
Line 494: return Pdb::q($q, [AdminAuth::getId()], 'map');
Line 503: if (! AdminAuth::isLoggedIn()) {

/sprout/Helpers/AdminPerms.php   Highlighted file source

Line 85: return array_keys(AdminAuth::getAllCategories());
Line 216: $cats = array_merge($cats, AdminAuth::getOperatorCategories());
Line 221: $admin_id = AdminAuth::getId();
Line 319: $res = Pdb::q($q, [AdminAuth::getId()], 'arr');
Line 374: $res = Pdb::q($q, [AdminAuth::getId()], 'arr');
Line 470: if (! AdminAuth::isLoggedIn()) {
Line 494: return Pdb::q($q, [AdminAuth::getId()], 'map');
Line 503: if (! AdminAuth::isLoggedIn()) {

/sprout/Helpers/Auth.php   Highlighted file source

Line 21: * Provides user authentication functions for the admin
Line 23: class Auth

/sprout/Helpers/Cron.php   Highlighted file source

Line 43: // Require admin auth for browser-based requests. These *should* be tunneled via
Line 48: AdminAuth::checkLogin();

/sprout/Helpers/Email.php   Highlighted file source

Line 47: $this->SMTPAuth = Kohana::config('sprout.smtp_auth');

/sprout/Helpers/Email.php   Highlighted file source

Line 47: $this->SMTPAuth = Kohana::config('sprout.smtp_auth');

/sprout/Helpers/PerRecordPerms.php   Highlighted file source

Line 62: $operator_cats = AdminAuth::getOperatorCategories();
Line 121: $all_cat_ids = array_keys(AdminAuth::getAllCategories());
Line 123: $all_cat_ids = AdminAuth::getOperatorCategories();
Line 133: $cat_ids[] = AdminAuth::getPrimaryCategoryId();

/sprout/Helpers/PerRecordPerms.php   Highlighted file source

Line 62: $operator_cats = AdminAuth::getOperatorCategories();
Line 121: $all_cat_ids = array_keys(AdminAuth::getAllCategories());
Line 123: $all_cat_ids = AdminAuth::getOperatorCategories();
Line 133: $cat_ids[] = AdminAuth::getPrimaryCategoryId();

/sprout/Helpers/Register.php   Highlighted file source

Line 360: if (AdminAuth::isSuper()) {

/sprout/Helpers/Register.php   Highlighted file source

Line 360: if (AdminAuth::isSuper()) {

/sprout/Helpers/Skin.php   Highlighted file source

Line 209: if ($unavail and !AdminAuth::isLoggedIn()) {

/sprout/Helpers/SproutVariable.php   Highlighted file source

Line 66: $this->admin = new AdminAuth();

/sprout/Helpers/Subsites.php   Highlighted file source

Line 78: AdminAuth::checkLogin();
Line 97: AdminAuth::checkLogin();
Line 252: AdminAuth::checkLogin();
Line 285: AdminAuth::checkLogin();

/sprout/Helpers/SubsiteSelector.php   Highlighted file source

Line 101: if (! AdminAuth::isLoggedIn()) continue;
Line 107: if (! UserAuth::isLoggedIn()) continue;
Line 117: // Check admin or user auth requirements for default subsite
Line 118: if (!AdminAuth::isLoggedIn() and PHP_SAPI !== 'cli') {
Line 120: AdminAuth::checkLogin();
Line 124: UserAuth::checkLogin();

/sprout/Helpers/SubsiteSelector.php   Highlighted file source

Line 101: if (! AdminAuth::isLoggedIn()) continue;
Line 107: if (! UserAuth::isLoggedIn()) continue;
Line 117: // Check admin or user auth requirements for default subsite
Line 118: if (!AdminAuth::isLoggedIn() and PHP_SAPI !== 'cli') {
Line 120: AdminAuth::checkLogin();
Line 124: UserAuth::checkLogin();

/sprout/Helpers/TwoFactor/GoogleAuthenticator.php   Highlighted file source

Line 19: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Line 30: class GoogleAuthenticator
Line 99: * For a given set of details, return the otpauth:// url for use in a QR code
Line 105: * @return string URL with the otpauth:// scheme
Line 113: return 'otpauth://totp/' . rawurlencode($issuer . ':' . $user . '@' . $host) . '?' . $params;

/sprout/Helpers/TwoFactor/GoogleAuthenticator.php   Highlighted file source

Line 19: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Line 30: class GoogleAuthenticator
Line 99: * For a given set of details, return the otpauth:// url for use in a QR code
Line 105: * @return string URL with the otpauth:// scheme
Line 113: return 'otpauth://totp/' . rawurlencode($issuer . ':' . $user . '@' . $host) . '?' . $params;

/sprout/Helpers/UserAuth.php   Highlighted file source

Line 23: * Will load the 'Helpers\UserAuth' class from the namespace
Line 26: class UserAuth
Line 31: public static $user_auth_inst = false;
Line 40: protected static function realUserAuthInst()
Line 42: if (self::$user_auth_inst !== false) {
Line 43: return self::$user_auth_inst;
Line 48: $class = $ns . '\Helpers\UserAuth';
Line 49: self::$user_auth_inst = Sprout::instance($class);
Line 51: self::$user_auth_inst = null;
Line 54: return self::$user_auth_inst;
Line 60: * See {@see SproutModules\Karmabunny\Users\Helpers\UserAuth::isLoggedIn}
Line 65: $inst = self::realUserAuthInst();
Line 76: * See {@see SproutModules\Karmabunny\Users\Helpers\UserAuth::getId}
Line 81: $inst = self::realUserAuthInst();

/sprout/Helpers/UserAuth.php   Highlighted file source

Line 23: * Will load the 'Helpers\UserAuth' class from the namespace
Line 26: class UserAuth
Line 31: public static $user_auth_inst = false;
Line 40: protected static function realUserAuthInst()
Line 42: if (self::$user_auth_inst !== false) {
Line 43: return self::$user_auth_inst;
Line 48: $class = $ns . '\Helpers\UserAuth';
Line 49: self::$user_auth_inst = Sprout::instance($class);
Line 51: self::$user_auth_inst = null;
Line 54: return self::$user_auth_inst;
Line 60: * See {@see SproutModules\Karmabunny\Users\Helpers\UserAuth::isLoggedIn}
Line 65: $inst = self::realUserAuthInst();
Line 76: * See {@see SproutModules\Karmabunny\Users\Helpers\UserAuth::getId}
Line 81: $inst = self::realUserAuthInst();

/sprout/Helpers/Validity.php   Highlighted file source

Line 279: * $valid->check('email', 'Validity::uniqueValue', 'users', 'email', UserAuth::get_id())

/sprout/Helpers/Widgets.php   Highlighted file source

Line 109: if ($orientation != WidgetArea::ORIENTATION_EMAIL and AdminAuth::isLoggedIn()) {

/sprout/sprout_load.php   Highlighted file source

Line 31: Register::pageattr('sprout.orig_author', 'Orig. Author');

/sprout/sprout_load.php   Highlighted file source

Line 31: Register::pageattr('sprout.orig_author', 'Orig. Author');

/sprout/tests/admin_authTest.php   Highlighted file source

Line 14: use Sprout\Helpers\AdminAuth;
Line 18: class admin_authTest extends PHPUnit_Framework_TestCase
Line 37: if (! AdminAuth::checkAlgorithm($alg)) return;
Line 39: list ($a, $b, $c) = AdminAuth::hashPassword('Match', $alg);
Line 40: $result = AdminAuth::doPasswordCheck($a, $b, $c, 'Match');
Line 44: list ($a, $b, $c) = AdminAuth::hashPassword('Match', $alg);
Line 45: $result = AdminAuth::doPasswordCheck($a, $b, $c, 'Do not match');
Line 57: if (! AdminAuth::checkAlgorithm($alg)) return;
Line 58: list ($a1, $b1, $c1) = AdminAuth::hashPassword('Match', $alg);
Line 59: list ($a2, $b2, $c2) = AdminAuth::hashPassword('Match', $alg);
Line 69: $this->assertTrue(AdminAuth::checkAlgorithm(Constants::PASSWORD_SHA_SALT));
Line 70: $this->assertTrue(AdminAuth::checkAlgorithm(Constants::PASSWORD_SHA_SALT_5000));
Line 71: $this->assertFalse(AdminAuth::checkAlgorithm(1234));

/sprout/tests/admin_authTest.php   Highlighted file source

Line 14: use Sprout\Helpers\AdminAuth;
Line 18: class admin_authTest extends PHPUnit_Framework_TestCase
Line 37: if (! AdminAuth::checkAlgorithm($alg)) return;
Line 39: list ($a, $b, $c) = AdminAuth::hashPassword('Match', $alg);
Line 40: $result = AdminAuth::doPasswordCheck($a, $b, $c, 'Match');
Line 44: list ($a, $b, $c) = AdminAuth::hashPassword('Match', $alg);
Line 45: $result = AdminAuth::doPasswordCheck($a, $b, $c, 'Do not match');
Line 57: if (! AdminAuth::checkAlgorithm($alg)) return;
Line 58: list ($a1, $b1, $c1) = AdminAuth::hashPassword('Match', $alg);
Line 59: list ($a2, $b2, $c2) = AdminAuth::hashPassword('Match', $alg);
Line 69: $this->assertTrue(AdminAuth::checkAlgorithm(Constants::PASSWORD_SHA_SALT));
Line 70: $this->assertTrue(AdminAuth::checkAlgorithm(Constants::PASSWORD_SHA_SALT_5000));
Line 71: $this->assertFalse(AdminAuth::checkAlgorithm(1234));

/sprout/views/admin/extra_page_edit.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 29: <?php if (AdminAuth::isSuper()): ?>

/sprout/views/admin/extra_page_edit.php   Highlighted file source

Line 18: use Sprout\Helpers\AdminAuth;
Line 29: <?php if (AdminAuth::isSuper()): ?>

/sprout/views/admin/file_add_dragdrop_form.php   Highlighted file source

Line 83: Form::nextFieldDetails('Author', false);
Line 84: echo Form::autocomplete('author', [], ['url' => 'admin/call/file/ajaxAuthorLookup', 'save_id' => false]);
Line 100: Form::nextFieldDetails('Embed author credit in image', false);
Line 101: echo Form::dropdown('embed_author', [], [1 => 'Yes', 0 => 'No']);

/sprout/views/admin/file_add_dragdrop_form.php   Highlighted file source

Line 83: Form::nextFieldDetails('Author', false);
Line 84: echo Form::autocomplete('author', [], ['url' => 'admin/call/file/ajaxAuthorLookup', 'save_id' => false]);
Line 100: Form::nextFieldDetails('Embed author credit in image', false);
Line 101: echo Form::dropdown('embed_author', [], [1 => 'Yes', 0 => 'No']);

/sprout/views/admin/file_edit.php   Highlighted file source

Line 57: <?php Form::nextFieldDetails('Author', false); ?>
Line 58: <?= Form::autocomplete('author', [], ['url' => 'admin/call/file/ajaxAuthorLookup', 'save_id' => false]); ?>

/sprout/views/admin/file_edit.php   Highlighted file source

Line 57: <?php Form::nextFieldDetails('Author', false); ?>
Line 58: <?= Form::autocomplete('author', [], ['url' => 'admin/call/file/ajaxAuthorLookup', 'save_id' => false]); ?>

/sprout/views/admin/main_layout.php   Highlighted file source

Line 17: use Sprout\Helpers\AdminAuth;
Line 111: <?php if (AdminAuth::isSuper()): ?>
Line 176: <?php $operator = AdminAuth::getDetails(); ?>
Line 189: <?php if (AdminAuth::hasDatabaseRecord()): ?>

/sprout/views/admin/main_layout.php   Highlighted file source

Line 17: use Sprout\Helpers\AdminAuth;
Line 111: <?php if (AdminAuth::isSuper()): ?>
Line 176: <?php $operator = AdminAuth::getDetails(); ?>
Line 189: <?php if (AdminAuth::hasDatabaseRecord()): ?>

/sprout/views/admin/page_navigation.php   Highlighted file source

Line 21: use Sprout\Helpers\AdminAuth;
Line 29: <?php if (AdminAuth::isSuper()): ?>

/sprout/views/admin/page_navigation.php   Highlighted file source

Line 21: use Sprout\Helpers\AdminAuth;
Line 29: <?php if (AdminAuth::isSuper()): ?>

/sprout/views/admin/tree_organise.php   Highlighted file source

Line 13: use Sprout\Helpers\AdminAuth;
Line 22: echo '<script>admin_auth = {is_remote: ', (AdminAuth::isSuper() ? 'true' : 'false'), '};</script>';

/sprout/views/admin/tree_organise.php   Highlighted file source

Line 13: use Sprout\Helpers\AdminAuth;
Line 22: echo '<script>admin_auth = {is_remote: ', (AdminAuth::isSuper() ? 'true' : 'false'), '};</script>';

A total of 663 lines in 93 files were found