diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-10-12 04:55:20 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-10-12 04:55:20 +0000 |
commit | ba62ca14b91934d9f5d81ff3a29fcf434acd1fdc (patch) | |
tree | 0b06c8d81016408a5141d347ca47bedd44adc286 /modules | |
parent | f5a47635bd7b3d4b3c12f0f6f42424316a074e71 (diff) | |
download | ampache-ba62ca14b91934d9f5d81ff3a29fcf434acd1fdc.tar.gz ampache-ba62ca14b91934d9f5d81ff3a29fcf434acd1fdc.tar.bz2 ampache-ba62ca14b91934d9f5d81ff3a29fcf434acd1fdc.zip |
added abilty to display and delete localplay instances
Diffstat (limited to 'modules')
-rw-r--r-- | modules/localplay/mpd.controller.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/localplay/mpd.controller.php b/modules/localplay/mpd.controller.php index 117c4c33..a35678ae 100644 --- a/modules/localplay/mpd.controller.php +++ b/modules/localplay/mpd.controller.php @@ -127,7 +127,7 @@ class AmpacheMpd extends localplay_controller { foreach ($data as $key=>$value) { switch ($key) { case 'name': - case 'hostname': + case 'host': case 'port': case 'password': ${$key} = Dba::escape($value); @@ -141,7 +141,7 @@ class AmpacheMpd extends localplay_controller { $user_id = Dba::escape($GLOBALS['user']->id); $sql = "INSERT INTO `localplay_mpd` (`name`,`host`,`port`,`password`,`owner`) " . - "VALUES ('$name','$hostname','$port','$password','$user_id')"; + "VALUES ('$name','$host','$port','$password','$user_id')"; $db_results = Dba::query($sql); return $db_results; @@ -153,7 +153,14 @@ class AmpacheMpd extends localplay_controller { * This takes a UID and deletes the instance in question */ public function delete_instance($uid) { + + $uid = Dba::escape($uid); + + // Go ahead and delete this mofo! + $sql = "DELETE FROM `localplay_mpd` WHERE `id`='$uid'"; + $db_results = Dba::query($sql); + return true; } // delete_instance @@ -204,7 +211,7 @@ class AmpacheMpd extends localplay_controller { public function instance_fields() { $fields['name'] = array('description'=>_('Instance Name'),'type'=>'textbox'); - $fields['hostname'] = array('description'=>_('Hostname'),'type'=>'textbox'); + $fields['host'] = array('description'=>_('Hostname'),'type'=>'textbox'); $fields['port'] = array('description'=>_('Port'),'type'=>'textbox'); $fields['password'] = array('description'=>_('Password'),'type'=>'textbox'); |