Complex classes like Security often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Security, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 33 | class Security extends Controller implements TemplateGlobalProvider { |
||
| 34 | |||
| 35 | private static $allowed_actions = array( |
||
| 36 | 'index', |
||
| 37 | 'login', |
||
| 38 | 'logout', |
||
| 39 | 'basicauthlogin', |
||
| 40 | 'lostpassword', |
||
| 41 | 'passwordsent', |
||
| 42 | 'changepassword', |
||
| 43 | 'ping', |
||
| 44 | 'LoginForm', |
||
| 45 | 'ChangePasswordForm', |
||
| 46 | 'LostPasswordForm', |
||
| 47 | ); |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Default user name. Only used in dev-mode by {@link setDefaultAdmin()} |
||
| 51 | * |
||
| 52 | * @var string |
||
| 53 | * @see setDefaultAdmin() |
||
| 54 | */ |
||
| 55 | protected static $default_username; |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Default password. Only used in dev-mode by {@link setDefaultAdmin()} |
||
| 59 | * |
||
| 60 | * @var string |
||
| 61 | * @see setDefaultAdmin() |
||
| 62 | */ |
||
| 63 | protected static $default_password; |
||
| 64 | |||
| 65 | /** |
||
| 66 | * If set to TRUE to prevent sharing of the session across several sites |
||
| 67 | * in the domain. |
||
| 68 | * |
||
| 69 | * @config |
||
| 70 | * @var bool |
||
| 71 | */ |
||
| 72 | protected static $strict_path_checking = false; |
||
| 73 | |||
| 74 | /** |
||
| 75 | * The password encryption algorithm to use by default. |
||
| 76 | * This is an arbitrary code registered through {@link PasswordEncryptor}. |
||
| 77 | * |
||
| 78 | * @config |
||
| 79 | * @var string |
||
| 80 | */ |
||
| 81 | private static $password_encryption_algorithm = 'blowfish'; |
||
| 82 | |||
| 83 | /** |
||
| 84 | * Showing "Remember me"-checkbox |
||
| 85 | * on loginform, and saving encrypted credentials to a cookie. |
||
| 86 | * |
||
| 87 | * @config |
||
| 88 | * @var bool |
||
| 89 | */ |
||
| 90 | private static $autologin_enabled = true; |
||
| 91 | |||
| 92 | /** |
||
| 93 | * Determine if login username may be remembered between login sessions |
||
| 94 | * If set to false this will disable autocomplete and prevent username persisting in the session |
||
| 95 | * |
||
| 96 | * @config |
||
| 97 | * @var bool |
||
| 98 | */ |
||
| 99 | private static $remember_username = true; |
||
| 100 | |||
| 101 | /** |
||
| 102 | * Location of word list to use for generating passwords |
||
| 103 | * |
||
| 104 | * @config |
||
| 105 | * @var string |
||
| 106 | */ |
||
| 107 | private static $word_list = './wordlist.txt'; |
||
| 108 | |||
| 109 | /** |
||
| 110 | * @config |
||
| 111 | * @var string |
||
| 112 | */ |
||
| 113 | private static $template = 'BlankPage'; |
||
| 114 | |||
| 115 | /** |
||
| 116 | * Template thats used to render the pages. |
||
| 117 | * |
||
| 118 | * @var string |
||
| 119 | * @config |
||
| 120 | */ |
||
| 121 | private static $template_main = 'Page'; |
||
| 122 | |||
| 123 | /** |
||
| 124 | * Default message set used in permission failures. |
||
| 125 | * |
||
| 126 | * @config |
||
| 127 | * @var array|string |
||
| 128 | */ |
||
| 129 | private static $default_message_set; |
||
| 130 | |||
| 131 | /** |
||
| 132 | * Random secure token, can be used as a crypto key internally. |
||
| 133 | * Generate one through 'sake dev/generatesecuretoken'. |
||
| 134 | * |
||
| 135 | * @config |
||
| 136 | * @var String |
||
| 137 | */ |
||
| 138 | private static $token; |
||
| 139 | |||
| 140 | /** |
||
| 141 | * The default login URL |
||
| 142 | * |
||
| 143 | * @config |
||
| 144 | * |
||
| 145 | * @var string |
||
| 146 | */ |
||
| 147 | private static $login_url = "Security/login"; |
||
| 148 | |||
| 149 | /** |
||
| 150 | * The default logout URL |
||
| 151 | * |
||
| 152 | * @config |
||
| 153 | * |
||
| 154 | * @var string |
||
| 155 | */ |
||
| 156 | private static $logout_url = "Security/logout"; |
||
| 157 | |||
| 158 | /** |
||
| 159 | * The default lost password URL |
||
| 160 | * |
||
| 161 | * @config |
||
| 162 | * |
||
| 163 | * @var string |
||
| 164 | */ |
||
| 165 | private static $lost_password_url = "Security/lostpassword"; |
||
| 166 | |||
| 167 | /** |
||
| 168 | * Get location of word list file |
||
| 169 | * |
||
| 170 | * @deprecated 4.0 Use the "Security.word_list" config setting instead |
||
| 171 | */ |
||
| 172 | public static function get_word_list() { |
||
| 176 | |||
| 177 | /** |
||
| 178 | * Enable or disable recording of login attempts |
||
| 179 | * through the {@link LoginRecord} object. |
||
| 180 | * |
||
| 181 | * @config |
||
| 182 | * @var boolean $login_recording |
||
| 183 | */ |
||
| 184 | private static $login_recording = false; |
||
| 185 | |||
| 186 | /** |
||
| 187 | * @var boolean If set to TRUE or FALSE, {@link database_is_ready()} |
||
| 188 | * will always return FALSE. Used for unit testing. |
||
| 189 | */ |
||
| 190 | static $force_database_is_ready = null; |
||
|
|
|||
| 191 | |||
| 192 | /** |
||
| 193 | * When the database has once been verified as ready, it will not do the |
||
| 194 | * checks again. |
||
| 195 | * |
||
| 196 | * @var bool |
||
| 197 | */ |
||
| 198 | static $database_is_ready = false; |
||
| 199 | |||
| 200 | /** |
||
| 201 | * Set location of word list file |
||
| 202 | * |
||
| 203 | * @deprecated 4.0 Use the "Security.word_list" config setting instead |
||
| 204 | * @param string $wordListFile Location of word list file |
||
| 205 | */ |
||
| 206 | public static function set_word_list($wordListFile) { |
||
| 210 | |||
| 211 | /** |
||
| 212 | * Set the default message set used in permissions failures. |
||
| 213 | * |
||
| 214 | * @deprecated 4.0 Use the "Security.default_message_set" config setting instead |
||
| 215 | * @param string|array $messageSet |
||
| 216 | */ |
||
| 217 | public static function set_default_message_set($messageSet) { |
||
| 221 | |||
| 222 | |||
| 223 | /** |
||
| 224 | * Register that we've had a permission failure trying to view the given page |
||
| 225 | * |
||
| 226 | * This will redirect to a login page. |
||
| 227 | * If you don't provide a messageSet, a default will be used. |
||
| 228 | * |
||
| 229 | * @param Controller $controller The controller that you were on to cause the permission |
||
| 230 | * failure. |
||
| 231 | * @param string|array $messageSet The message to show to the user. This |
||
| 232 | * can be a string, or a map of different |
||
| 233 | * messages for different contexts. |
||
| 234 | * If you pass an array, you can use the |
||
| 235 | * following keys: |
||
| 236 | * - default: The default message |
||
| 237 | * - alreadyLoggedIn: The message to |
||
| 238 | * show if the user |
||
| 239 | * is already logged |
||
| 240 | * in and lacks the |
||
| 241 | * permission to |
||
| 242 | * access the item. |
||
| 243 | * |
||
| 244 | * The alreadyLoggedIn value can contain a '%s' placeholder that will be replaced with a link |
||
| 245 | * to log in. |
||
| 246 | * @return SS_HTTPResponse |
||
| 247 | */ |
||
| 248 | public static function permissionFailure($controller = null, $messageSet = null) { |
||
| 341 | |||
| 342 | protected function init() { |
||
| 348 | |||
| 349 | public function index() { |
||
| 352 | |||
| 353 | /** |
||
| 354 | * Get the selected authenticator for this request |
||
| 355 | * |
||
| 356 | * @return string Class name of Authenticator |
||
| 357 | */ |
||
| 358 | protected function getAuthenticator() { |
||
| 370 | |||
| 371 | /** |
||
| 372 | * Get the login form to process according to the submitted data |
||
| 373 | * |
||
| 374 | * @return Form |
||
| 375 | * @throws Exception |
||
| 376 | */ |
||
| 377 | public function LoginForm() { |
||
| 382 | |||
| 383 | /** |
||
| 384 | * Get the login forms for all available authentication methods |
||
| 385 | * |
||
| 386 | * @return array Returns an array of available login forms (array of Form |
||
| 387 | * objects). |
||
| 388 | * |
||
| 389 | * @todo Check how to activate/deactivate authentication methods |
||
| 390 | */ |
||
| 391 | public function GetLoginForms() { |
||
| 401 | |||
| 402 | |||
| 403 | /** |
||
| 404 | * Get a link to a security action |
||
| 405 | * |
||
| 406 | * @param string $action Name of the action |
||
| 407 | * @return string Returns the link to the given action |
||
| 408 | */ |
||
| 409 | public function Link($action = null) { |
||
| 413 | |||
| 414 | /** |
||
| 415 | * This action is available as a keep alive, so user |
||
| 416 | * sessions don't timeout. A common use is in the admin. |
||
| 417 | */ |
||
| 418 | public function ping() { |
||
| 421 | |||
| 422 | /** |
||
| 423 | * Log the currently logged in user out |
||
| 424 | * |
||
| 425 | * @param bool $redirect Redirect the user back to where they came. |
||
| 426 | * - If it's false, the code calling logout() is |
||
| 427 | * responsible for sending the user where-ever |
||
| 428 | * they should go. |
||
| 429 | */ |
||
| 430 | public function logout($redirect = true) { |
||
| 438 | |||
| 439 | /** |
||
| 440 | * Perform pre-login checking and prepare a response if available prior to login |
||
| 441 | * |
||
| 442 | * @return SS_HTTPResponse Substitute response object if the login process should be curcumvented. |
||
| 443 | * Returns null if should proceed as normal. |
||
| 444 | */ |
||
| 445 | protected function preLogin() { |
||
| 471 | |||
| 472 | /** |
||
| 473 | * Prepare the controller for handling the response to this request |
||
| 474 | * |
||
| 475 | * @param string $title Title to use |
||
| 476 | * @return Controller |
||
| 477 | */ |
||
| 478 | protected function getResponseController($title) { |
||
| 494 | |||
| 495 | /** |
||
| 496 | * Determine the list of templates to use for rendering the given action |
||
| 497 | * |
||
| 498 | * @param string $action |
||
| 499 | * @return array Template list |
||
| 500 | */ |
||
| 501 | public function getTemplatesFor($action) { |
||
| 505 | |||
| 506 | /** |
||
| 507 | * Combine the given forms into a formset with a tabbed interface |
||
| 508 | * |
||
| 509 | * @param array $forms List of LoginForm instances |
||
| 510 | * @return string |
||
| 511 | */ |
||
| 512 | protected function generateLoginFormSet($forms) { |
||
| 520 | |||
| 521 | /** |
||
| 522 | * Get the HTML Content for the $Content area during login |
||
| 523 | * |
||
| 524 | * @param string &$messageType Type of message, if available, passed back to caller |
||
| 525 | * @return string Message in HTML format |
||
| 526 | */ |
||
| 527 | protected function getLoginMessage(&$messageType = null) { |
||
| 539 | |||
| 540 | |||
| 541 | /** |
||
| 542 | * Show the "login" page |
||
| 543 | * |
||
| 544 | * For multiple authenticators, Security_MultiAuthenticatorLogin is used. |
||
| 545 | * See getTemplatesFor and getIncludeTemplate for how to override template logic |
||
| 546 | * |
||
| 547 | * @return string|SS_HTTPResponse Returns the "login" page as HTML code. |
||
| 548 | */ |
||
| 549 | public function login() { |
||
| 593 | |||
| 594 | public function basicauthlogin() { |
||
| 598 | |||
| 599 | /** |
||
| 600 | * Show the "lost password" page |
||
| 601 | * |
||
| 602 | * @return string Returns the "lost password" page as HTML code. |
||
| 603 | */ |
||
| 604 | public function lostpassword() { |
||
| 624 | |||
| 625 | |||
| 626 | /** |
||
| 627 | * Factory method for the lost password form |
||
| 628 | * |
||
| 629 | * @return Form Returns the lost password form |
||
| 630 | */ |
||
| 631 | public function LostPasswordForm() { |
||
| 647 | |||
| 648 | |||
| 649 | /** |
||
| 650 | * Show the "password sent" page, after a user has requested |
||
| 651 | * to reset their password. |
||
| 652 | * |
||
| 653 | * @param SS_HTTPRequest $request The SS_HTTPRequest for this action. |
||
| 654 | * @return string Returns the "password sent" page as HTML code. |
||
| 655 | */ |
||
| 656 | public function passwordsent($request) { |
||
| 680 | |||
| 681 | |||
| 682 | /** |
||
| 683 | * Create a link to the password reset form. |
||
| 684 | * |
||
| 685 | * GET parameters used: |
||
| 686 | * - m: member ID |
||
| 687 | * - t: plaintext token |
||
| 688 | * |
||
| 689 | * @param Member $member Member object associated with this link. |
||
| 690 | * @param string $autologinToken The auto login token. |
||
| 691 | * @return string |
||
| 692 | */ |
||
| 693 | public static function getPasswordResetLink($member, $autologinToken) { |
||
| 699 | |||
| 700 | /** |
||
| 701 | * Show the "change password" page. |
||
| 702 | * This page can either be called directly by logged-in users |
||
| 703 | * (in which case they need to provide their old password), |
||
| 704 | * or through a link emailed through {@link lostpassword()}. |
||
| 705 | * In this case no old password is required, authentication is ensured |
||
| 706 | * through the Member.AutoLoginHash property. |
||
| 707 | * |
||
| 708 | * @see ChangePasswordForm |
||
| 709 | * |
||
| 710 | * @return string Returns the "change password" page as HTML code. |
||
| 711 | */ |
||
| 712 | public function changepassword() { |
||
| 778 | |||
| 779 | /** |
||
| 780 | * Factory method for the lost password form |
||
| 781 | * |
||
| 782 | * @return ChangePasswordForm Returns the lost password form |
||
| 783 | */ |
||
| 784 | public function ChangePasswordForm() { |
||
| 792 | |||
| 793 | /** |
||
| 794 | * Gets the template for an include used for security. |
||
| 795 | * For use in any subclass. |
||
| 796 | * |
||
| 797 | * @param string $name |
||
| 798 | * @return array Returns the template(s) for rendering |
||
| 799 | */ |
||
| 800 | public function getIncludeTemplate($name) { |
||
| 803 | |||
| 804 | /** |
||
| 805 | * Return an existing member with administrator privileges, or create one of necessary. |
||
| 806 | * |
||
| 807 | * Will create a default 'Administrators' group if no group is found |
||
| 808 | * with an ADMIN permission. Will create a new 'Admin' member with administrative permissions |
||
| 809 | * if no existing Member with these permissions is found. |
||
| 810 | * |
||
| 811 | * Important: Any newly created administrator accounts will NOT have valid |
||
| 812 | * login credentials (Email/Password properties), which means they can't be used for login |
||
| 813 | * purposes outside of any default credentials set through {@link Security::setDefaultAdmin()}. |
||
| 814 | * |
||
| 815 | * @return Member |
||
| 816 | */ |
||
| 817 | public static function findAnAdministrator() { |
||
| 866 | |||
| 867 | /** |
||
| 868 | * Flush the default admin credentials |
||
| 869 | */ |
||
| 870 | public static function clear_default_admin() { |
||
| 874 | |||
| 875 | |||
| 876 | /** |
||
| 877 | * Set a default admin in dev-mode |
||
| 878 | * |
||
| 879 | * This will set a static default-admin which is not existing |
||
| 880 | * as a database-record. By this workaround we can test pages in dev-mode |
||
| 881 | * with a unified login. Submitted login-credentials are first checked |
||
| 882 | * against this static information in {@link Security::authenticate()}. |
||
| 883 | * |
||
| 884 | * @param string $username The user name |
||
| 885 | * @param string $password The password (in cleartext) |
||
| 886 | * @return bool |
||
| 887 | */ |
||
| 888 | public static function setDefaultAdmin($username, $password) { |
||
| 897 | |||
| 898 | /** |
||
| 899 | * Checks if the passed credentials are matching the default-admin. |
||
| 900 | * Compares cleartext-password set through Security::setDefaultAdmin(). |
||
| 901 | * |
||
| 902 | * @param string $username |
||
| 903 | * @param string $password |
||
| 904 | * @return bool |
||
| 905 | */ |
||
| 906 | public static function check_default_admin($username, $password) { |
||
| 913 | |||
| 914 | /** |
||
| 915 | * Check that the default admin account has been set. |
||
| 916 | */ |
||
| 917 | public static function has_default_admin() { |
||
| 920 | |||
| 921 | /** |
||
| 922 | * Get default admin username |
||
| 923 | * |
||
| 924 | * @return string |
||
| 925 | */ |
||
| 926 | public static function default_admin_username() { |
||
| 929 | |||
| 930 | /** |
||
| 931 | * Get default admin password |
||
| 932 | * |
||
| 933 | * @return string |
||
| 934 | */ |
||
| 935 | public static function default_admin_password() { |
||
| 938 | |||
| 939 | /** |
||
| 940 | * Set strict path checking |
||
| 941 | * |
||
| 942 | * This prevents sharing of the session across several sites in the |
||
| 943 | * domain. |
||
| 944 | * |
||
| 945 | * @deprecated 4.0 Use the "Security.strict_path_checking" config setting instead |
||
| 946 | * @param boolean $strictPathChecking To enable or disable strict patch |
||
| 947 | * checking. |
||
| 948 | */ |
||
| 949 | public static function setStrictPathChecking($strictPathChecking) { |
||
| 953 | |||
| 954 | |||
| 955 | /** |
||
| 956 | * Get strict path checking |
||
| 957 | * |
||
| 958 | * @deprecated 4.0 Use the "Security.strict_path_checking" config setting instead |
||
| 959 | * @return boolean Status of strict path checking |
||
| 960 | */ |
||
| 961 | public static function getStrictPathChecking() { |
||
| 965 | |||
| 966 | |||
| 967 | /** |
||
| 968 | * Set the password encryption algorithm |
||
| 969 | * |
||
| 970 | * @deprecated 4.0 Use the "Security.password_encryption_algorithm" config setting instead |
||
| 971 | * @param string $algorithm One of the available password encryption |
||
| 972 | * algorithms determined by {@link Security::get_encryption_algorithms()} |
||
| 973 | * @return bool Returns TRUE if the passed algorithm was valid, otherwise FALSE. |
||
| 974 | */ |
||
| 975 | public static function set_password_encryption_algorithm($algorithm) { |
||
| 980 | |||
| 981 | /** |
||
| 982 | * @deprecated 4.0 Use the "Security.password_encryption_algorithm" config setting instead |
||
| 983 | * @return String |
||
| 984 | */ |
||
| 985 | public static function get_password_encryption_algorithm() { |
||
| 989 | |||
| 990 | /** |
||
| 991 | * Encrypt a password according to the current password encryption settings. |
||
| 992 | * If the settings are so that passwords shouldn't be encrypted, the |
||
| 993 | * result is simple the clear text password with an empty salt except when |
||
| 994 | * a custom algorithm ($algorithm parameter) was passed. |
||
| 995 | * |
||
| 996 | * @param string $password The password to encrypt |
||
| 997 | * @param string $salt Optional: The salt to use. If it is not passed, but |
||
| 998 | * needed, the method will automatically create a |
||
| 999 | * random salt that will then be returned as return value. |
||
| 1000 | * @param string $algorithm Optional: Use another algorithm to encrypt the |
||
| 1001 | * password (so that the encryption algorithm can be changed over the time). |
||
| 1002 | * @param Member $member Optional |
||
| 1003 | * @return mixed Returns an associative array containing the encrypted |
||
| 1004 | * password and the used salt in the form: |
||
| 1005 | * <code> |
||
| 1006 | * array( |
||
| 1007 | * 'password' => string, |
||
| 1008 | * 'salt' => string, |
||
| 1009 | * 'algorithm' => string, |
||
| 1010 | * 'encryptor' => PasswordEncryptor instance |
||
| 1011 | * ) |
||
| 1012 | * </code> |
||
| 1013 | * If the passed algorithm is invalid, FALSE will be returned. |
||
| 1014 | * |
||
| 1015 | * @see encrypt_passwords() |
||
| 1016 | */ |
||
| 1017 | public static function encrypt_password($password, $salt = null, $algorithm = null, $member = null) { |
||
| 1033 | |||
| 1034 | /** |
||
| 1035 | * Checks the database is in a state to perform security checks. |
||
| 1036 | * See {@link DatabaseAdmin->init()} for more information. |
||
| 1037 | * |
||
| 1038 | * @return bool |
||
| 1039 | */ |
||
| 1040 | public static function database_is_ready() { |
||
| 1087 | |||
| 1088 | /** |
||
| 1089 | * Enable or disable recording of login attempts |
||
| 1090 | * through the {@link LoginRecord} object. |
||
| 1091 | * |
||
| 1092 | * @deprecated 4.0 Use the "Security.login_recording" config setting instead |
||
| 1093 | * @param boolean $bool |
||
| 1094 | */ |
||
| 1095 | public static function set_login_recording($bool) { |
||
| 1099 | |||
| 1100 | /** |
||
| 1101 | * @deprecated 4.0 Use the "Security.login_recording" config setting instead |
||
| 1102 | * @return boolean |
||
| 1103 | */ |
||
| 1104 | public static function login_recording() { |
||
| 1108 | |||
| 1109 | /** |
||
| 1110 | * @config |
||
| 1111 | * @var string Set the default login dest |
||
| 1112 | * This is the URL that users will be redirected to after they log in, |
||
| 1113 | * if they haven't logged in en route to access a secured page. |
||
| 1114 | * By default, this is set to the homepage. |
||
| 1115 | */ |
||
| 1116 | private static $default_login_dest = ""; |
||
| 1117 | |||
| 1118 | /** |
||
| 1119 | * @deprecated 4.0 Use the "Security.default_login_dest" config setting instead |
||
| 1120 | */ |
||
| 1121 | public static function set_default_login_dest($dest) { |
||
| 1125 | |||
| 1126 | /** |
||
| 1127 | * Get the default login dest. |
||
| 1128 | * |
||
| 1129 | * @deprecated 4.0 Use the "Security.default_login_dest" config setting instead |
||
| 1130 | */ |
||
| 1131 | public static function default_login_dest() { |
||
| 1135 | |||
| 1136 | protected static $ignore_disallowed_actions = false; |
||
| 1137 | |||
| 1138 | /** |
||
| 1139 | * Set to true to ignore access to disallowed actions, rather than returning permission failure |
||
| 1140 | * Note that this is just a flag that other code needs to check with Security::ignore_disallowed_actions() |
||
| 1141 | * @param $flag True or false |
||
| 1142 | */ |
||
| 1143 | public static function set_ignore_disallowed_actions($flag) { |
||
| 1146 | |||
| 1147 | public static function ignore_disallowed_actions() { |
||
| 1150 | |||
| 1151 | |||
| 1152 | /** |
||
| 1153 | * Set a custom log-in URL if you have built your own log-in page. |
||
| 1154 | * |
||
| 1155 | * @deprecated 4.0 Use the "Security.login_url" config setting instead. |
||
| 1156 | */ |
||
| 1157 | public static function set_login_url($loginUrl) { |
||
| 1161 | |||
| 1162 | |||
| 1163 | /** |
||
| 1164 | * Get the URL of the log-in page. |
||
| 1165 | * |
||
| 1166 | * To update the login url use the "Security.login_url" config setting. |
||
| 1167 | * |
||
| 1168 | * @return string |
||
| 1169 | */ |
||
| 1170 | public static function login_url() { |
||
| 1173 | |||
| 1174 | |||
| 1175 | /** |
||
| 1176 | * Get the URL of the logout page. |
||
| 1177 | * |
||
| 1178 | * To update the logout url use the "Security.logout_url" config setting. |
||
| 1179 | * |
||
| 1180 | * @return string |
||
| 1181 | */ |
||
| 1182 | public static function logout_url() { |
||
| 1185 | |||
| 1186 | /** |
||
| 1187 | * Get the URL of the logout page. |
||
| 1188 | * |
||
| 1189 | * To update the logout url use the "Security.logout_url" config setting. |
||
| 1190 | * |
||
| 1191 | * @return string |
||
| 1192 | */ |
||
| 1193 | public static function lost_password_url() { |
||
| 1196 | |||
| 1197 | /** |
||
| 1198 | * Defines global accessible templates variables. |
||
| 1199 | * |
||
| 1200 | * @return array |
||
| 1201 | */ |
||
| 1202 | public static function get_template_global_variables() { |
||
| 1209 | |||
| 1210 | } |
||
| 1211 |
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.