summaryrefslogtreecommitdiffstats
path: root/lib/class
diff options
context:
space:
mode:
Diffstat (limited to 'lib/class')
-rw-r--r--lib/class/access.class.php3
-rw-r--r--lib/class/album.class.php5
-rw-r--r--lib/class/artist.class.php2
-rw-r--r--lib/class/catalog.class.php3
-rw-r--r--lib/class/error.class.php2
-rw-r--r--lib/class/genre.class.php2
-rw-r--r--lib/class/playlist.class.php2
-rw-r--r--lib/class/rating.class.php2
-rw-r--r--lib/class/song.class.php2
-rw-r--r--lib/class/stream.class.php2
-rw-r--r--lib/class/update.class.php2
-rw-r--r--lib/class/user.class.php33
-rw-r--r--lib/class/view.class.php2
13 files changed, 47 insertions, 15 deletions
diff --git a/lib/class/access.class.php b/lib/class/access.class.php
index 85fc3a81..8a0ad168 100644
--- a/lib/class/access.class.php
+++ b/lib/class/access.class.php
@@ -1,6 +1,9 @@
<?php
/*
+ Copyright (c) 2001 - 2006 Ampache.org
+ All Rights Reserved
+
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
diff --git a/lib/class/album.class.php b/lib/class/album.class.php
index 5b56d90a..08da4c4e 100644
--- a/lib/class/album.class.php
+++ b/lib/class/album.class.php
@@ -1,7 +1,8 @@
<?php
/*
- Copyright (c) 2004
- Ampache.org
+
+ Copyright (c) 2001 - 2006 Ampache.org
+ All Rights Reserved
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php
index 5f9267b3..961b5991 100644
--- a/lib/class/artist.class.php
+++ b/lib/class/artist.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2004 Ampache.org
+ Copyright (c) 2001 - 2006 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index 2265afba..dcbf074e 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -1,6 +1,9 @@
<?php
/*
+ Copyright (c) 2001 - 2006 Ampache.org
+ All Rights Reserved
+
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
diff --git a/lib/class/error.class.php b/lib/class/error.class.php
index 5515e41c..b3e74ba5 100644
--- a/lib/class/error.class.php
+++ b/lib/class/error.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2005 Ampache.org
+ Copyright (c) 2001 - 2006 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
diff --git a/lib/class/genre.class.php b/lib/class/genre.class.php
index dd664c5b..5d4e13d1 100644
--- a/lib/class/genre.class.php
+++ b/lib/class/genre.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright 2001 - 2005 Ampache.org
+ Copyright 2001 - 2006 Ampache.org
All Rights Reserved
This program is free software; you can redistribute it and/or
diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php
index 765a2219..279134ee 100644
--- a/lib/class/playlist.class.php
+++ b/lib/class/playlist.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2005 Ampache.org
+ Copyright (c) 2001 - 2006 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
diff --git a/lib/class/rating.class.php b/lib/class/rating.class.php
index 06344e1c..f9dd0794 100644
--- a/lib/class/rating.class.php
+++ b/lib/class/rating.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2005 Ampache.org
+ Copyright (c) 2001 - 2006 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index d857e68a..e0f7dd36 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2004 Ampache.org
+ Copyright (c) 2001 - 2006 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php
index 16a7c722..9bf5b7f1 100644
--- a/lib/class/stream.class.php
+++ b/lib/class/stream.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2005 Ampache.org
+ Copyright (c) 2001 - 2006 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
diff --git a/lib/class/update.class.php b/lib/class/update.class.php
index d6890465..4977135a 100644
--- a/lib/class/update.class.php
+++ b/lib/class/update.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2005 Ampache.org
+ Copyright (c) 2001 - 2006 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
diff --git a/lib/class/user.class.php b/lib/class/user.class.php
index 8442da90..83b473a3 100644
--- a/lib/class/user.class.php
+++ b/lib/class/user.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2005 Ampache.org
+ Copyright (c) 2001 - 2006 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
@@ -36,6 +36,8 @@ class User {
var $offset_limit=25;
var $email;
var $last_seen;
+ var $reg_date;
+ var $validation;
function User($username=0) {
@@ -52,6 +54,8 @@ class User {
$this->offset_limit = $info->offset_limit;
$this->email = $info->email;
$this->last_seen = $info->last_seen;
+ $this->reg_date = $info->reg_date;
+ $this->validation = $info->validation;
$this->set_preferences();
// Make sure the Full name is always filled
@@ -476,10 +480,9 @@ class User {
$username = sql_escape($username);
$fullname = sql_escape($fullname);
$email = sql_escape($email);
-
/* Now Insert this new user */
- $sql = "INSERT INTO user (username, fullname, email, password, access) VALUES" .
- " ('$username','$fullname','$email',PASSWORD('$password'),'$access')";
+ $sql = "INSERT INTO user (username, fullname, email, password, access, reg_date) VALUES" .
+ " ('$username','$fullname','$email',PASSWORD('$password'),'$access', unix_timestamp())";
$db_results = mysql_query($sql, dbh());
if (!$db_results) { return false; }
@@ -737,9 +740,31 @@ class User {
@description calcs difference between now and last_seen
if less than delay, we consider them still online
*/
+
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){
+ $sql = "SELECT validation FROM user where username='$username'";
+ $db_results = mysql_query($sql, dbh());
+ $row = mysql_fetch_array($db_results);
+ $val = $row[validation];
+ return $val;
+ } // get_user_validation
+
+ /*!
+ @function activate_user
+ @activates the user from public_registration
+ */
+ function activate_user($username) {
+ $sql = "UPDATE user SET disabled='0' WHERE username='$username'";
+ $db_results = mysql_query($sql, dbh());
+ } // activate_user
} //end class
+
?>
diff --git a/lib/class/view.class.php b/lib/class/view.class.php
index 112148ad..afc81b22 100644
--- a/lib/class/view.class.php
+++ b/lib/class/view.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2004 Ampache.org
+ Copyright (c) 2001 - 2006 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or