1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 17:59:21 +02:00

some other minor changes, nothing big

This commit is contained in:
Karl 'vollmerk' Vollmer 2008-11-29 18:38:46 +00:00
parent 73809f0c1d
commit 245b69d645
4 changed files with 8 additions and 22 deletions

View file

@ -131,27 +131,17 @@ switch ($_REQUEST['action']) {
case 'enable': case 'enable':
$client = new User($_REQUEST['user_id']); $client = new User($_REQUEST['user_id']);
$client->enable(); $client->enable();
show_confirmation(_('User Enabled'),'','admin/users.php'); show_confirmation(_('User Enabled'),$client->fullname . ' (' . $client->username . ')','admin/users.php');
break; break;
case 'disable': case 'disable':
$client = new User($_REQUEST['user_id']); $client = new User($_REQUEST['user_id']);
if ($client->disable()) { if ($client->disable()) {
show_confirmation(_('User Disabled'),'','admin/users.php'); show_confirmation(_('User Disabled'),$client->fullname . ' (' . $client->username . ')','admin/users.php');
} }
else { else {
show_confirmation(_('Error'),_('Unable to Disabled last Administrator'),'admin/users.php'); show_confirmation(_('Error'),_('Unable to Disabled last Administrator'),'admin/users.php');
} }
break; break;
} // End Work Switch
/**
* This is the second half, it handles displaying anything
* the first half (work half) potentially has 'adjusted' the user
* input
*/
switch ($_REQUEST['action']) {
case 'show_edit': case 'show_edit':
if (Config::get('demo_mode')) { break; } if (Config::get('demo_mode')) { break; }
$client = new User($_REQUEST['user_id']); $client = new User($_REQUEST['user_id']);

View file

@ -49,7 +49,7 @@ class Api {
if (intval($version) < self::$version) { if (intval($version) < self::$version) {
debug_event('API','Login Failed version too old','1'); debug_event('API','Login Failed version too old','1');
Error::add('api','Login Failed versoin too old'); Error::add('api','Login Failed version too old');
return false; return false;
} }

View file

@ -109,6 +109,9 @@ class Tag extends database_object {
$data = self::get_top_tags($type,$object_id); $data = self::get_top_tags($type,$object_id);
} }
// If nothing is found, then go ahead and return false
if (!is_array($data) OR !count($data)) { return false; }
$this->weight = $data[$this->id]['count']; $this->weight = $data[$this->id]['count'];
if (in_array($GLOBALS['user']->id,$data[$this->id]['users'])) { if (in_array($GLOBALS['user']->id,$data[$this->id]['users'])) {

View file

@ -124,15 +124,8 @@ function search_song($data,$operator,$method,$limit) {
{ {
if($ii++ > 0) if($ii++ > 0)
$where_sql .= " AND "; $where_sql .= " AND ";
$where_sql .= " $where_sql .= "(song.title LIKE '%$word%' OR album2.name LIKE '%$word%' OR artist2.name LIKE '%$word%' OR
( song.year LIKE '%$word%' OR song.file LIKE '%$word%' OR tag2.name LIKE '%$word%') ";
song.title LIKE '%$word%' OR
album2.name LIKE '%$word%' OR
artist2.name LIKE '%$word%' OR
song.year LIKE '%$word%' OR
song.file LIKE '%$word%' OR
tag2.name LIKE '%$word%'
) ";
} }
$where_sql .= " ) $operator"; $where_sql .= " ) $operator";
$table_sql .= " LEFT JOIN `album` as `album2` ON `song`.`album`=`album2`.`id`"; $table_sql .= " LEFT JOIN `album` as `album2` ON `song`.`album`=`album2`.`id`";