Ticket #499: swt_auth_demo_model.patch

File swt_auth_demo_model.patch, 0.6 kB (added by Stalwart, 9 months ago)

model patch

  • models/user.php

    old new  
    8888                return (bool) self::$db->where('username', $name)->count_records('users'); 
    8989        } 
    9090 
     91        /** 
     92         * Tests if a email exists in the database. 
     93         * 
     94         * @param   string   email to check 
     95         * @return  bool 
     96         */ 
     97        public function email_exists($email) 
     98        { 
     99                return (bool) self::$db->where('email', $email)->count_records('users'); 
     100        } 
     101 
    91102        /** 
    92103         * Allows a model to be loaded by username or email address. 
    93104         */