diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-12-02 16:40:03 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-12-02 16:40:03 +0000 |
commit | 552c3cedd78263ce385d0ac47b02ccd22ea474b3 (patch) | |
tree | 7042da2e17c73afad01d7004884dd1d903cff293 /lib/class/user.class.php | |
parent | 66e0b8ea9dd675a778a5c5777cce547887b2720c (diff) | |
download | ampache-552c3cedd78263ce385d0ac47b02ccd22ea474b3.tar.gz ampache-552c3cedd78263ce385d0ac47b02ccd22ea474b3.tar.bz2 ampache-552c3cedd78263ce385d0ac47b02ccd22ea474b3.zip |
fixed registration page, and simplifed its logic
Diffstat (limited to 'lib/class/user.class.php')
-rw-r--r-- | lib/class/user.class.php | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/lib/class/user.class.php b/lib/class/user.class.php index 3870f910..1fa24adb 100644 --- a/lib/class/user.class.php +++ b/lib/class/user.class.php @@ -942,34 +942,34 @@ class User { } // delete - /*! - @function is_online - @parameter delay how long since last_seen in seconds default of 20 min - @description calcs difference between now and last_seen - if less than delay, we consider them still online - */ - - function is_online( $delay = 1200 ) { + /** + * is_online + * delay how long since last_seen in seconds default of 20 min + * calcs difference between now and last_seen + * if less than delay, we consider them still online + */ + public function is_online( $delay = 1200 ) { + return time() - $this->last_seen <= $delay; - } - /*! - @function get_user_validation - @check if user exists before activation can be done. - */ - function get_user_validation($username,$validation) { + } // is_online + + /** + * get_user_validation + *if user exists before activation can be done. + */ + public static function get_validation($username) { - $usename = sql_escape($username); + $usename = Dba::escape($username); - $sql = "SELECT validation FROM user where username='$username'"; - $db_results = mysql_query($sql, dbh()); + $sql = "SELECT `validation` FROM `user` WHERE `username`='$username'"; + $db_results = Dba::query($sql); - $row = mysql_fetch_assoc($db_results); - $val = $row['validation']; + $row = Dba::fetch_assoc($db_results); - return $val; + return $row['validation']; - } // get_user_validation + } // get_validation /** * get_recently_played |