diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-03-16 05:25:00 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-03-16 05:25:00 +0000 |
commit | 16f655ba45459c5a0d1be76d1f43094f49dfd0a7 (patch) | |
tree | 2e365e5f6625e8ef307211e58b92a3233b016044 /lib | |
parent | e2bf8254895b30b679865585b37e72aa1e867320 (diff) | |
download | ampache-16f655ba45459c5a0d1be76d1f43094f49dfd0a7.tar.gz ampache-16f655ba45459c5a0d1be76d1f43094f49dfd0a7.tar.bz2 ampache-16f655ba45459c5a0d1be76d1f43094f49dfd0a7.zip |
new tabbed preferences and account page is back
Diffstat (limited to 'lib')
-rw-r--r-- | lib/class/user.class.php | 15 | ||||
-rw-r--r-- | lib/ui.lib.php | 16 |
2 files changed, 12 insertions, 19 deletions
diff --git a/lib/class/user.class.php b/lib/class/user.class.php index 084ae359..dbcbd97d 100644 --- a/lib/class/user.class.php +++ b/lib/class/user.class.php @@ -29,6 +29,7 @@ class User { //Basic Componets + var $id; var $username; var $fullname; var $access; @@ -46,6 +47,7 @@ class User { } $this->username = sql_escape($username); + $this->id = $this->username; $info = $this->get_info(); $this->username = $info->username; $this->fullname = $info->fullname; @@ -82,11 +84,12 @@ class User { * get_preferences * This is a little more complicate now that we've got many types of preferences * This funtions pulls all of them an arranges them into a spiffy little array + * You can specify a type to limit it to a single type of preference * []['title'] = ucased type name * []['prefs'] = array(array('name','display','value')); * []['admin'] = t/f value if this is an admin only section */ - function get_preferences($user_id=0) { + function get_preferences($user_id=0,$type=0) { if (!$user_id) { $user_id = $this->username; @@ -97,6 +100,10 @@ class User { if ($user_id != '-1') { $user_limit = "AND preferences.type != 'system'"; } + + if ($type != '0') { + $user_limit = "AND preferences.type = '" . sql_escape($type) . "'"; + } $sql = "SELECT preferences.name, preferences.description, preferences.type, user_preference.value FROM preferences,user_preference " . @@ -332,7 +339,7 @@ class User { function update_fullname($new_fullname) { $new_fullname = sql_escape($new_fullname); - $sql = "UPDATE user SET fullname='$new_fullname' WHERE username='$this->username'"; + $sql = "UPDATE user SET fullname='$new_fullname' WHERE username='$this->id'"; $db_results = mysql_query($sql, dbh()); } // update_username @@ -344,7 +351,7 @@ class User { function update_email($new_email) { $new_email = sql_escape($new_email); - $sql = "UPDATE user SET email='$new_email' WHERE username='$this->username'"; + $sql = "UPDATE user SET email='$new_email' WHERE username='$this->id'"; $db_results = mysql_query($sql, dbh()); } // update_email @@ -356,7 +363,7 @@ class User { function update_offset($new_offset) { $new_offset = sql_escape($new_offset); - $sql = "UPDATE user SET offset_limit='$new_offset' WHERE username='$this->username'"; + $sql = "UPDATE user SET offset_limit='$new_offset' WHERE username='$this->id'"; $db_results = mysql_query($sql, dbh()); } // update_offset diff --git a/lib/ui.lib.php b/lib/ui.lib.php index 8b7891dd..7dd36aad 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -417,20 +417,6 @@ function show_user_registration ($values=array()) { } // show_user_registration /** - * show_edit_profile - * shows a single user profile for editing - * @package Web Interface - * @catagory Display - */ -function show_edit_profile($username) { - - $this_user = new User($username); - - require (conf('prefix') . "/templates/show_user.inc.php"); - -} // show_edit_profile - -/** * show_play_selected * this shows the playselected/add to playlist * box, which includes a little javascript @@ -1039,7 +1025,7 @@ function get_location() { * it does not contain the <form> </form> tags */ function show_preference_box($preferences) { - + include (conf('prefix') . '/templates/show_preference_box.inc.php'); } // show_preference_box |