Ignore:
Timestamp:
Nov 30, 2013 7:30:44 PM (11 years ago)
Author:
anonymous
Message:

added public and private keywords to all properties and methods, changed old classname constructor function to construct, removed more ?> closing tags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eli_branch/lib/Auth_SQL.inc.php

    r432 r439  
    4141       
    4242    // Namespace of this auth object.
    43     var $_ns;
     43    private $_ns;
    4444   
    4545    // Static var for test.
    46     var $_authentication_tested;
     46    private $_authentication_tested;
    4747
    4848    // Parameters to be configured by setParam.
    49     var $_params = array();
    50     var $_default_params = array(
     49    private $_params = array();
     50    private $_default_params = array(
    5151
    5252        // Automatically create table and verify columns. Better set to false after site launch.
     
    127127     * @param optional array $params  A hash containing parameters.
    128128     */
    129     function Auth_SQL($namespace='')
     129    public function __construct($namespace='')
    130130    {
    131131        $app =& App::getInstance();
     
    153153     * @since   26 Aug 2005 17:09:36
    154154     */
    155     function initDB($recreate_db=false)
     155    public function initDB($recreate_db=false)
    156156    {
    157157        $app =& App::getInstance();
     
    253253     * @return bool true on success, false on failure
    254254     */
    255     function setParam($params)
     255    public function setParam($params)
    256256    {
    257257        if (isset($params['match_remote_ip_exempt_usernames'])) {
     
    274274     * @return mixed               Configured parameter value.
    275275     */
    276     function getParam($param)
     276    public function getParam($param)
    277277    {
    278278        $app =& App::getInstance();
     
    291291     * @access public
    292292     */
    293     function clear()
     293    public function clear()
    294294    {
    295295        $db =& DB::getInstance();
     
    326326     * @param mixed $val      Value to set variable to.
    327327     */
    328     function set($key, $val)
     328    public function set($key, $val)
    329329    {
    330330        if (!isset($_SESSION['_auth_sql'][$this->_ns]['user_data'])) {
     
    342342     * @return mixed          Value stored in session.
    343343     */
    344     function get($key, $default='')
     344    public function get($key, $default='')
    345345    {
    346346        if (isset($_SESSION['_auth_sql'][$this->_ns][$key])) {
     
    361361     * @return mixed  False if credentials not found in DB, or returns DB row matching credentials.
    362362     */
    363     function authenticate($username, $password)
     363    public function authenticate($username, $password)
    364364    {
    365365        $app =& App::getInstance();
     
    412412     * @return boolean  Whether or not the credentials are valid.
    413413     */
    414     function login($username, $password)
     414    public function login($username, $password)
    415415    {
    416416        $app =& App::getInstance();
     
    534534     * @access public
    535535     */
    536     function isLoggedIn($user_id=null)
     536    public function isLoggedIn($user_id=null)
    537537    {
    538538        $app =& App::getInstance();
     
    668668     * @access public
    669669     */
    670     function requireLogin($message='', $type=MSG_NOTICE, $file=null, $line=null)
     670    public function requireLogin($message='', $type=MSG_NOTICE, $file=null, $line=null)
    671671    {
    672672        $app =& App::getInstance();
     
    690690     * @param  string   $reason      The reason for blocking the account.
    691691     */
    692     function blockAccount($user_id=null, $reason='')
     692    public function blockAccount($user_id=null, $reason='')
    693693    {
    694694        $app =& App::getInstance();
     
    720720     * @return boolean              True if the user is blocked, false otherwise.
    721721     */
    722     function isBlocked($user_id=null)
     722    public function isBlocked($user_id=null)
    723723    {
    724724        $db =& DB::getInstance();
     
    742742     * Unblocks a user in the db_table, and clears any blocked_reason.
    743743     */
    744     function unblockAccount($user_id=null)
     744    public function unblockAccount($user_id=null)
    745745    {
    746746        $db =& DB::getInstance();
     
    766766     * @return bool                 True if username exists.
    767767     */
    768     function usernameExists($username)
     768    public function usernameExists($username)
    769769    {
    770770        $db =& DB::getInstance();
     
    786786     * @return string               Username, or false if none found.
    787787     */
    788     function getUsername($user_id)
     788    public function getUsername($user_id)
    789789    {
    790790        $db =& DB::getInstance();
     
    820820     * @return string           a password
    821821     */
    822     function generatePassword($pattern='CvcdCvc')
     822    public function generatePassword($pattern='CvcdCvc')
    823823    {
    824824        $app =& App::getInstance();
     
    843843     *
    844844     */
    845     function encryptPassword($password, $salt=null)
     845    public function encryptPassword($password, $salt=null)
    846846    {
    847847        $app =& App::getInstance();
     
    898898     *
    899899     */
    900     function setPassword($user_id=null, $password)
     900    public function setPassword($user_id=null, $password)
    901901    {
    902902        $app =& App::getInstance();
     
    948948     * @return string            The user's new password.
    949949     */
    950     function resetPassword($user_id=null, $reason='')
     950    public function resetPassword($user_id=null, $reason='')
    951951    {
    952952        $app =& App::getInstance();
     
    10131013     * @return bool     true if user is a member of security zone, false otherwise
    10141014     */
    1015     function inClearanceZone($security_zone, $user_type='')
     1015    public function inClearanceZone($security_zone, $user_type='')
    10161016    {
    10171017        // return true; /// WTF?
     
    10361036     * @param  constant $security_zone   string of comma delimited privileges for the zone
    10371037     */
    1038     function requireAccessClearance($security_zone, $message='')
     1038    public function requireAccessClearance($security_zone, $message='')
    10391039    {
    10401040        $app =& App::getInstance();
     
    10941094// 128.0.0.0        10000000.00000000.00000000.00000000  /1
    10951095// 0.0.0.0          00000000.00000000.00000000.00000000  /0   IP space
    1096 ?>
Note: See TracChangeset for help on using the changeset viewer.