mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-06 03:49:56 +02:00
Update translate strings
Change indent tab from blank Fix show_confirmation web_path
This commit is contained in:
parent
b85fa736cf
commit
bd3b70008b
8 changed files with 96 additions and 96 deletions
|
@ -32,6 +32,7 @@ show_header();
|
||||||
/* Big switch statement to handle various actions */
|
/* Big switch statement to handle various actions */
|
||||||
switch ($_REQUEST['action']) {
|
switch ($_REQUEST['action']) {
|
||||||
case 'fixed':
|
case 'fixed':
|
||||||
|
/* Does this use now? */
|
||||||
delete_flagged($flag);
|
delete_flagged($flag);
|
||||||
$type = 'show_flagged_songs';
|
$type = 'show_flagged_songs';
|
||||||
include(conf('prefix') . '/templates/flag.inc');
|
include(conf('prefix') . '/templates/flag.inc');
|
||||||
|
@ -42,13 +43,13 @@ switch ($_REQUEST['action']) {
|
||||||
case 'add_to_catalog':
|
case 'add_to_catalog':
|
||||||
toggle_visible('ajax-loading');
|
toggle_visible('ajax-loading');
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
if (Config::get('demo_mode')) { break; }
|
if (Config::get('demo_mode')) { break; }
|
||||||
if ($_REQUEST['catalogs'] ) {
|
if ($_REQUEST['catalogs'] ) {
|
||||||
foreach ($_REQUEST['catalogs'] as $catalog_id) {
|
foreach ($_REQUEST['catalogs'] as $catalog_id) {
|
||||||
$catalog = new Catalog($catalog_id);
|
$catalog = new Catalog($catalog_id);
|
||||||
$catalog->add_to_catalog();
|
$catalog->add_to_catalog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$url = Config::get('web_path') . '/admin/index.php';
|
$url = Config::get('web_path') . '/admin/index.php';
|
||||||
$title = _('Catalog Updated');
|
$title = _('Catalog Updated');
|
||||||
$body = '';
|
$body = '';
|
||||||
|
@ -60,8 +61,8 @@ switch ($_REQUEST['action']) {
|
||||||
case 'update_catalog':
|
case 'update_catalog':
|
||||||
toggle_visible('ajax-loading');
|
toggle_visible('ajax-loading');
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
/* If they are in demo mode stop here */
|
/* If they are in demo mode stop here */
|
||||||
if (Config::get('demo_mode')) { break; }
|
if (Config::get('demo_mode')) { break; }
|
||||||
|
|
||||||
if (isset($_REQUEST['catalogs'])) {
|
if (isset($_REQUEST['catalogs'])) {
|
||||||
foreach ($_REQUEST['catalogs'] as $catalog_id) {
|
foreach ($_REQUEST['catalogs'] as $catalog_id) {
|
||||||
|
@ -102,7 +103,7 @@ switch ($_REQUEST['action']) {
|
||||||
break;
|
break;
|
||||||
case 'delete_catalog':
|
case 'delete_catalog':
|
||||||
/* Make sure they aren't in demo mode */
|
/* Make sure they aren't in demo mode */
|
||||||
if (Config::get('demo_mode')) { break; }
|
if (Config::get('demo_mode')) { break; }
|
||||||
|
|
||||||
if (!Core::form_verify('delete_catalog')) {
|
if (!Core::form_verify('delete_catalog')) {
|
||||||
access_denied();
|
access_denied();
|
||||||
|
@ -121,7 +122,7 @@ switch ($_REQUEST['action']) {
|
||||||
show_confirmation(_('Catalog Delete'),_('Confirm Deletion Request'),$next_url,1,'delete_catalog');
|
show_confirmation(_('Catalog Delete'),_('Confirm Deletion Request'),$next_url,1,'delete_catalog');
|
||||||
break;
|
break;
|
||||||
case 'remove_disabled':
|
case 'remove_disabled':
|
||||||
if (conf('demo_mode')) { break; }
|
if (conf('demo_mode')) { break; }
|
||||||
|
|
||||||
$song = $_REQUEST['song'];
|
$song = $_REQUEST['song'];
|
||||||
|
|
||||||
|
@ -142,8 +143,8 @@ switch ($_REQUEST['action']) {
|
||||||
case 'clean_catalog':
|
case 'clean_catalog':
|
||||||
toggle_visible('ajax-loading');
|
toggle_visible('ajax-loading');
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
/* If they are in demo mode stop them here */
|
/* If they are in demo mode stop them here */
|
||||||
if (Config::get('demo_mode')) { break; }
|
if (Config::get('demo_mode')) { break; }
|
||||||
|
|
||||||
// Make sure they checked something
|
// Make sure they checked something
|
||||||
if (isset($_REQUEST['catalogs'])) {
|
if (isset($_REQUEST['catalogs'])) {
|
||||||
|
@ -161,7 +162,7 @@ switch ($_REQUEST['action']) {
|
||||||
break;
|
break;
|
||||||
case 'update_catalog_settings':
|
case 'update_catalog_settings':
|
||||||
/* No Demo Here! */
|
/* No Demo Here! */
|
||||||
if (Config::get('demo_mode')) { break; }
|
if (Config::get('demo_mode')) { break; }
|
||||||
|
|
||||||
/* Update the catalog */
|
/* Update the catalog */
|
||||||
Catalog::update_settings($_REQUEST);
|
Catalog::update_settings($_REQUEST);
|
||||||
|
@ -198,20 +199,20 @@ switch ($_REQUEST['action']) {
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
|
|
||||||
if (!strlen($_REQUEST['path']) || !strlen($_REQUEST['name'])) {
|
if (!strlen($_REQUEST['path']) || !strlen($_REQUEST['name'])) {
|
||||||
Error::add('general','Error Name and path not specified');
|
Error::add('general',_('Error: Name and path not specified'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (substr($_REQUEST['path'],0,7) != 'http://' && $_REQUEST['type'] == 'remote') {
|
if (substr($_REQUEST['path'],0,7) != 'http://' && $_REQUEST['type'] == 'remote') {
|
||||||
Error::add('general','Error Remote selected, but path is not a URL');
|
Error::add('general',_('Error: Remote selected, but path is not a URL'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_REQUEST['type'] == 'remote' && !strlen($_REQUEST['key'])) {
|
if ($_REQUEST['type'] == 'remote' && !strlen($_REQUEST['key'])) {
|
||||||
Error::add('general','Error Remote Catalog specified, but no key provided');
|
Error::add('general',_('Error: Remote Catalog specified, but no key provided'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure that there isn't a catalog with a directory above this one
|
// Make sure that there isn't a catalog with a directory above this one
|
||||||
if (Catalog::get_from_path($_REQUEST['path'])) {
|
if (Catalog::get_from_path($_REQUEST['path'])) {
|
||||||
Error::add('general',_('Error: Defined Path is inside an existing catalog'));
|
Error::add('general',_('Error: Defined Path is inside an existing catalog'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If an error hasn't occured
|
// If an error hasn't occured
|
||||||
|
@ -222,10 +223,10 @@ switch ($_REQUEST['action']) {
|
||||||
if (!$catalog_id) {
|
if (!$catalog_id) {
|
||||||
require Config::get('prefix') . '/templates/show_add_catalog.inc.php';
|
require Config::get('prefix') . '/templates/show_add_catalog.inc.php';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$catalog = new Catalog($catalog_id);
|
$catalog = new Catalog($catalog_id);
|
||||||
|
|
||||||
// Run our initial add
|
// Run our initial add
|
||||||
$catalog->run_add($_REQUEST);
|
$catalog->run_add($_REQUEST);
|
||||||
|
|
||||||
|
@ -243,7 +244,7 @@ switch ($_REQUEST['action']) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'clear_stats':
|
case 'clear_stats':
|
||||||
if (Config::get('demo_mode')) { access_denied(); break; }
|
if (Config::get('demo_mode')) { access_denied(); break; }
|
||||||
|
|
||||||
Catalog::clear_stats();
|
Catalog::clear_stats();
|
||||||
$url = Config::get('web_path') . '/admin/index.php';
|
$url = Config::get('web_path') . '/admin/index.php';
|
||||||
|
@ -258,12 +259,13 @@ switch ($_REQUEST['action']) {
|
||||||
require Config::get('prefix') . '/templates/show_add_catalog.inc.php';
|
require Config::get('prefix') . '/templates/show_add_catalog.inc.php';
|
||||||
break;
|
break;
|
||||||
case 'clear_now_playing':
|
case 'clear_now_playing':
|
||||||
if (Config::get('demo_mode')) { access_denied(); break; }
|
if (Config::get('demo_mode')) { access_denied(); break; }
|
||||||
Stream::clear_now_playing();
|
Stream::clear_now_playing();
|
||||||
show_confirmation(_('Now Playing Cleared'),_('All now playing data has been cleared'),Config::get('web_path') . '/admin/index.php');
|
show_confirmation(_('Now Playing Cleared'),_('All now playing data has been cleared'),Config::get('web_path') . '/admin/index.php');
|
||||||
break;
|
break;
|
||||||
case 'show_disabled':
|
case 'show_disabled':
|
||||||
if (conf('demo_mode')) { break; }
|
/* Stop the demo hippies */
|
||||||
|
if (conf('demo_mode')) { break; }
|
||||||
|
|
||||||
$songs = $catalog->get_disabled();
|
$songs = $catalog->get_disabled();
|
||||||
if (count($songs)) {
|
if (count($songs)) {
|
||||||
|
@ -275,7 +277,7 @@ switch ($_REQUEST['action']) {
|
||||||
break;
|
break;
|
||||||
case 'show_delete_catalog':
|
case 'show_delete_catalog':
|
||||||
/* Stop the demo hippies */
|
/* Stop the demo hippies */
|
||||||
if (Config::get('demo_mode')) { access_denied(); break; }
|
if (Config::get('demo_mode')) { access_denied(); break; }
|
||||||
|
|
||||||
$catalog = new Catalog($_REQUEST['catalog_id']);
|
$catalog = new Catalog($_REQUEST['catalog_id']);
|
||||||
$nexturl = Config::get('web_path') . '/admin/catalog.php?action=delete_catalog&catalog_id=' . scrub_out($_REQUEST['catalog_id']);
|
$nexturl = Config::get('web_path') . '/admin/catalog.php?action=delete_catalog&catalog_id=' . scrub_out($_REQUEST['catalog_id']);
|
||||||
|
@ -302,7 +304,7 @@ switch ($_REQUEST['action']) {
|
||||||
$title = _('Album Art Search Finished');
|
$title = _('Album Art Search Finished');
|
||||||
$body = '';
|
$body = '';
|
||||||
show_confirmation($title,$body,$url);
|
show_confirmation($title,$body,$url);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* Not sure what to put here anymore */
|
/* Not sure what to put here anymore */
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -175,7 +175,7 @@ switch ($_REQUEST['action']) {
|
||||||
/* Done by 'Select' code passes array of song ids */
|
/* Done by 'Select' code passes array of song ids */
|
||||||
case 'mass_update':
|
case 'mass_update':
|
||||||
$songs = $_REQUEST['song'];
|
$songs = $_REQUEST['song'];
|
||||||
$catalog = new Catalog();
|
$catalog = new Catalog();
|
||||||
$object = $_REQUEST['update_field'];
|
$object = $_REQUEST['update_field'];
|
||||||
$flag = new Flag();
|
$flag = new Flag();
|
||||||
|
|
||||||
|
@ -199,10 +199,10 @@ switch ($_REQUEST['action']) {
|
||||||
foreach ($songs as $song_id) {
|
foreach ($songs as $song_id) {
|
||||||
|
|
||||||
$new_song = new Song($song_id);
|
$new_song = new Song($song_id);
|
||||||
$old_song = new Song();
|
$old_song = new Song();
|
||||||
$old_song->artist = $new_song->artist;
|
$old_song->artist = $new_song->artist;
|
||||||
$old_song->album = $new_song->album;
|
$old_song->album = $new_song->album;
|
||||||
$old_song->genre = $new_song->genre;
|
$old_song->genre = $new_song->genre;
|
||||||
|
|
||||||
/* Restrict which fields can be updated */
|
/* Restrict which fields can be updated */
|
||||||
switch ($object) {
|
switch ($object) {
|
||||||
|
@ -223,11 +223,11 @@ switch ($_REQUEST['action']) {
|
||||||
break;
|
break;
|
||||||
} // end switch
|
} // end switch
|
||||||
|
|
||||||
/* Update this mofo, store an old copy for cleaning */
|
/* Update this mofo, store an old copy for cleaning */
|
||||||
$new_song->update_song($song_id,$new_song);
|
$new_song->update_song($song_id,$new_song);
|
||||||
|
|
||||||
/* Now that it's been updated clean old junk entries */
|
/* Now that it's been updated clean old junk entries */
|
||||||
$cleaned = $catalog->clean_single_song($old_song);
|
$cleaned = $catalog->clean_single_song($old_song);
|
||||||
|
|
||||||
$flag->add($song_id,'song','retag','Edited Song, auto-tag');
|
$flag->add($song_id,'song','retag','Edited Song, auto-tag');
|
||||||
|
|
||||||
|
@ -267,13 +267,13 @@ switch ($_REQUEST['action']) {
|
||||||
$song->fill_ext_info();
|
$song->fill_ext_info();
|
||||||
$song->format_song();
|
$song->format_song();
|
||||||
require_once (conf('prefix') . '/templates/show_edit_song.inc.php');
|
require_once (conf('prefix') . '/templates/show_edit_song.inc.php');
|
||||||
break;
|
break;
|
||||||
case 'disable':
|
case 'disable':
|
||||||
$song_obj = new Song();
|
$song_obj = new Song();
|
||||||
// If we pass just one, make it still work
|
// If we pass just one, make it still work
|
||||||
if (!is_array($_REQUEST['song_ids'])) { $song_obj->update_enabled(0,$_REQUEST['song_ids']); }
|
if (!is_array($_REQUEST['song_ids'])) { $song_obj->update_enabled(0,$_REQUEST['song_ids']); }
|
||||||
else {
|
else {
|
||||||
foreach ($_REQUEST['song_ids'] as $song_id) {
|
foreach ($_REQUEST['song_ids'] as $song_id) {
|
||||||
$song_obj->update_enabled(0,$song_id);
|
$song_obj->update_enabled(0,$song_id);
|
||||||
} // end foreach
|
} // end foreach
|
||||||
} // end else
|
} // end else
|
||||||
|
@ -282,14 +282,14 @@ switch ($_REQUEST['action']) {
|
||||||
case 'enabled':
|
case 'enabled':
|
||||||
$song_obj = new Song();
|
$song_obj = new Song();
|
||||||
// If we pass just one, make it still work
|
// If we pass just one, make it still work
|
||||||
if (!is_array($_REQUEST['song_ids'])) { $song_obj->update_enabled(1,$_REQUEST['song_ids']); }
|
if (!is_array($_REQUEST['song_ids'])) { $song_obj->update_enabled(1,$_REQUEST['song_ids']); }
|
||||||
else {
|
else {
|
||||||
foreach ($_REQUEST['song_ids'] as $song_id) {
|
foreach ($_REQUEST['song_ids'] as $song_id) {
|
||||||
$song_obj->update_enabled(1,$song_id);
|
$song_obj->update_enabled(1,$song_id);
|
||||||
} // end foreach
|
} // end foreach
|
||||||
} // end else
|
} // end else
|
||||||
show_confirmation(_('Songs Enabled'),_('The requested song(s) have been enabled'),return_referer());
|
show_confirmation(_('Songs Enabled'),_('The requested song(s) have been enabled'),return_referer());
|
||||||
break;
|
break;
|
||||||
case 'show_disabled':
|
case 'show_disabled':
|
||||||
$disabled = Flag::get_disabled();
|
$disabled = Flag::get_disabled();
|
||||||
Browse::set_type('song');
|
Browse::set_type('song');
|
||||||
|
@ -310,4 +310,3 @@ switch ($_REQUEST['action']) {
|
||||||
|
|
||||||
show_footer();
|
show_footer();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
|
@ -38,3 +38,4 @@ switch ($_REQUEST['action']) {
|
||||||
}
|
}
|
||||||
|
|
||||||
show_footer();
|
show_footer();
|
||||||
|
?>
|
||||||
|
|
|
@ -73,7 +73,7 @@ switch ($_REQUEST['action']) {
|
||||||
|
|
||||||
AmpacheMail::$fromname = $fullname;
|
AmpacheMail::$fromname = $fullname;
|
||||||
AmpacheMail::send();
|
AmpacheMail::send();
|
||||||
|
|
||||||
/* Confirmation Send */
|
/* Confirmation Send */
|
||||||
$url = Config::get('web_path') . '/admin/mail.php';
|
$url = Config::get('web_path') . '/admin/mail.php';
|
||||||
$title = _('E-mail Sent');
|
$title = _('E-mail Sent');
|
||||||
|
|
|
@ -63,11 +63,11 @@ switch ($_REQUEST['action']) {
|
||||||
$localplay = new Localplay($type);
|
$localplay = new Localplay($type);
|
||||||
$localplay->uninstall();
|
$localplay->uninstall();
|
||||||
|
|
||||||
/* Show Confirmation */
|
/* Show Confirmation */
|
||||||
$url = Config::get('web_path') . '/admin/modules.php?action=show_localplay';
|
$url = Config::get('web_path') . '/admin/modules.php?action=show_localplay';
|
||||||
$title = _('Plugin Deactivated');
|
$title = _('Plugin Deactivated');
|
||||||
$body = '';
|
$body = '';
|
||||||
show_confirmation($title,$body,$url);
|
show_confirmation($title,$body,$url);
|
||||||
break;
|
break;
|
||||||
case 'install_plugin':
|
case 'install_plugin':
|
||||||
/* Verify that this plugin exists */
|
/* Verify that this plugin exists */
|
||||||
|
@ -79,7 +79,7 @@ switch ($_REQUEST['action']) {
|
||||||
$plugin = new Plugin($_REQUEST['plugin']);
|
$plugin = new Plugin($_REQUEST['plugin']);
|
||||||
if (!$plugin->install()) {
|
if (!$plugin->install()) {
|
||||||
debug_event('plugins','Error: Plugin Install Failed, ' . $_REQUEST['plugin'],'1');
|
debug_event('plugins','Error: Plugin Install Failed, ' . $_REQUEST['plugin'],'1');
|
||||||
$url = Config::get('web_path') . '/admin/modules.php?action=show_plugins';
|
$url = Config::get('web_path') . '/admin/modules.php?action=show_plugins';
|
||||||
$title = _('Unable to Install Plugin');
|
$title = _('Unable to Install Plugin');
|
||||||
$body = '';
|
$body = '';
|
||||||
show_confirmation($title,$body,$url);
|
show_confirmation($title,$body,$url);
|
||||||
|
@ -104,22 +104,22 @@ switch ($_REQUEST['action']) {
|
||||||
break;
|
break;
|
||||||
case 'uninstall_plugin':
|
case 'uninstall_plugin':
|
||||||
/* Verify that this plugin exists */
|
/* Verify that this plugin exists */
|
||||||
$plugins = Plugin::get_plugins();
|
$plugins = Plugin::get_plugins();
|
||||||
if (!array_key_exists($_REQUEST['plugin'],$plugins)) {
|
if (!array_key_exists($_REQUEST['plugin'],$plugins)) {
|
||||||
debug_event('plugins','Error: Invalid Plugin: ' . $_REQUEST['plugin'] . ' selected','1');
|
debug_event('plugins','Error: Invalid Plugin: ' . $_REQUEST['plugin'] . ' selected','1');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$plugin = new Plugin($_REQUEST['plugin']);
|
$plugin = new Plugin($_REQUEST['plugin']);
|
||||||
$plugin->uninstall();
|
$plugin->uninstall();
|
||||||
|
|
||||||
// Don't trust the plugin to do it
|
// Don't trust the plugin to do it
|
||||||
User::rebuild_all_preferences();
|
User::rebuild_all_preferences();
|
||||||
|
|
||||||
/* Show Confirmation */
|
/* Show Confirmation */
|
||||||
$url = Config::get('web_path') . '/admin/modules.php?action=show_plugins';
|
$url = Config::get('web_path') . '/admin/modules.php?action=show_plugins';
|
||||||
$title = _('Plugin Deactivated');
|
$title = _('Plugin Deactivated');
|
||||||
$body = '';
|
$body = '';
|
||||||
show_confirmation($title,$body,$url);
|
show_confirmation($title,$body,$url);
|
||||||
break;
|
break;
|
||||||
case 'upgrade_plugin':
|
case 'upgrade_plugin':
|
||||||
|
|
||||||
|
@ -143,5 +143,4 @@ switch ($_REQUEST['action']) {
|
||||||
|
|
||||||
show_footer();
|
show_footer();
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
require_once '../lib/init.php';
|
require_once '../lib/init.php';
|
||||||
|
|
||||||
if (!Access::check('interface','100')) {
|
if (!Access::check('interface','100')) {
|
||||||
access_denied();
|
access_denied();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
show_header();
|
show_header();
|
||||||
|
@ -32,19 +32,19 @@ switch ($_REQUEST['action']) {
|
||||||
case 'edit_shout':
|
case 'edit_shout':
|
||||||
$shout_id = $_POST['shout_id'];
|
$shout_id = $_POST['shout_id'];
|
||||||
$update = shoutBox::update($_POST);
|
$update = shoutBox::update($_POST);
|
||||||
show_confirmation(_('Shoutbox Post Updated'),'','admin/shout.php');
|
show_confirmation(_('Shoutbox Post Updated'),'',Config::get('web_path').'/admin/shout.php');
|
||||||
break;
|
break;
|
||||||
case 'show_edit':
|
case 'show_edit':
|
||||||
$shout = new shoutBox($_REQUEST['shout_id']);
|
$shout = new shoutBox($_REQUEST['shout_id']);
|
||||||
$object = shoutBox::get_object($shout->object_type,$shout->object_id);
|
$object = shoutBox::get_object($shout->object_type,$shout->object_id);
|
||||||
$object->format();
|
$object->format();
|
||||||
$client = new User($shout->user);
|
$client = new User($shout->user);
|
||||||
$client->format();
|
$client->format();
|
||||||
require_once Config::get('prefix') . '/templates/show_edit_shout.inc.php';
|
require_once Config::get('prefix') . '/templates/show_edit_shout.inc.php';
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
case 'delete':
|
||||||
$shout_id = shoutBox::delete($_REQUEST['shout_id']);
|
$shout_id = shoutBox::delete($_REQUEST['shout_id']);
|
||||||
show_confirmation(_('Shoutbox Post Deleted'),'','admin/shout.php');
|
show_confirmation(_('Shoutbox Post Deleted'),'',Config::get('web_path').'/admin/shout.php');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Browse::set_type('shoutbox');
|
Browse::set_type('shoutbox');
|
||||||
|
|
|
@ -39,25 +39,24 @@ switch ($_REQUEST['action']) {
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
$current = parse_ini_file(Config::get('prefix') . '/config/ampache.cfg.php');
|
$current = parse_ini_file(Config::get('prefix') . '/config/ampache.cfg.php');
|
||||||
$final = generate_config($current);
|
$final = generate_config($current);
|
||||||
$browser = new Browser();
|
$browser = new Browser();
|
||||||
$browser->downloadHeaders('ampache.cfg.php','text/plain',false,filesize(Config::get('prefix') . '/config/ampache.cfg.php.dist'));
|
$browser->downloadHeaders('ampache.cfg.php','text/plain',false,filesize(Config::get('prefix') . '/config/ampache.cfg.php.dist'));
|
||||||
echo $final;
|
echo $final;
|
||||||
exit;
|
exit;
|
||||||
break;
|
break;
|
||||||
case 'reset_db_charset':
|
case 'reset_db_charset':
|
||||||
Dba::reset_db_charset();
|
Dba::reset_db_charset();
|
||||||
show_confirmation(_('Database Charset Updated'),_('Your Database and associated tables have been updated to match your currently configured charset'),'/admin/system.php?action=show_debug');
|
show_confirmation(_('Database Charset Updated'),_('Your Database and associated tables have been updated to match your currently configured charset'), Config::get('web_path').'/admin/system.php?action=show_debug');
|
||||||
break;
|
break;
|
||||||
case 'show_debug':
|
case 'show_debug':
|
||||||
$configuration = Config::get_all();
|
$configuration = Config::get_all();
|
||||||
require_once Config::get('prefix') . '/templates/show_debug.inc.php';
|
require_once Config::get('prefix') . '/templates/show_debug.inc.php';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// Rien a faire
|
// Rien a faire
|
||||||
break;
|
break;
|
||||||
} // end switch
|
} // end switch
|
||||||
|
|
||||||
|
|
||||||
show_footer();
|
show_footer();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -31,8 +31,8 @@ show_header();
|
||||||
// Switch on the actions
|
// Switch on the actions
|
||||||
switch ($_REQUEST['action']) {
|
switch ($_REQUEST['action']) {
|
||||||
case 'update_user':
|
case 'update_user':
|
||||||
if (Config::get('demo_mode')) { break; }
|
if (Config::get('demo_mode')) { break; }
|
||||||
|
|
||||||
if (!Core::form_verify('edit_user','post')) {
|
if (!Core::form_verify('edit_user','post')) {
|
||||||
access_denied();
|
access_denied();
|
||||||
exit;
|
exit;
|
||||||
|
@ -48,7 +48,7 @@ switch ($_REQUEST['action']) {
|
||||||
$pass2 = scrub_in($_POST['password_2']);
|
$pass2 = scrub_in($_POST['password_2']);
|
||||||
|
|
||||||
/* Setup the temp user */
|
/* Setup the temp user */
|
||||||
$client = new User($user_id);
|
$client = new User($user_id);
|
||||||
|
|
||||||
/* Verify Input */
|
/* Verify Input */
|
||||||
if (empty($username)) {
|
if (empty($username)) {
|
||||||
|
@ -80,15 +80,15 @@ switch ($_REQUEST['action']) {
|
||||||
$client->update_password($pass1);
|
$client->update_password($pass1);
|
||||||
}
|
}
|
||||||
|
|
||||||
show_confirmation(_('User Updated'), $client->fullname . "(" . $client->username . ")" . _('updated'),'admin/users.php');
|
show_confirmation(_('User Updated'), $client->fullname . "(" . $client->username . ")" . _('updated'), Config::get('web_path'). '/admin/users.php');
|
||||||
break;
|
break;
|
||||||
case 'add_user':
|
case 'add_user':
|
||||||
if (Config::get('demo_mode')) { break; }
|
if (Config::get('demo_mode')) { break; }
|
||||||
|
|
||||||
if (!Core::form_verify('add_user','post')) {
|
if (!Core::form_verify('add_user','post')) {
|
||||||
access_denied();
|
access_denied();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$username = scrub_in($_POST['username']);
|
$username = scrub_in($_POST['username']);
|
||||||
$fullname = scrub_in($_POST['fullname']);
|
$fullname = scrub_in($_POST['fullname']);
|
||||||
|
@ -114,9 +114,9 @@ switch ($_REQUEST['action']) {
|
||||||
/* Attempt to create the user */
|
/* Attempt to create the user */
|
||||||
$user_id = User::create($username, $fullname, $email, $pass1, $access);
|
$user_id = User::create($username, $fullname, $email, $pass1, $access);
|
||||||
if (!$user_id) {
|
if (!$user_id) {
|
||||||
Error::add('general',"Error: Insert Failed");
|
Error::add('general',_("Error: Insert Failed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // if no errors
|
} // if no errors
|
||||||
else {
|
else {
|
||||||
$_REQUEST['action'] = 'show_add_user';
|
$_REQUEST['action'] = 'show_add_user';
|
||||||
|
@ -126,49 +126,49 @@ switch ($_REQUEST['action']) {
|
||||||
elseif ($access == 25){ $access = _('User');}
|
elseif ($access == 25){ $access = _('User');}
|
||||||
elseif ($access == 100){ $access = _('Admin');}
|
elseif ($access == 100){ $access = _('Admin');}
|
||||||
|
|
||||||
show_confirmation(_('New User Added'),__('%user% has been created with an access level of ' . $access,'%user%',$username),'admin/users.php');
|
show_confirmation(_('New User Added'),__('%user% has been created with an access level of ' . $access,'%user%',$username), Config::get('web_path').'/admin/users.php');
|
||||||
break;
|
break;
|
||||||
case 'enable':
|
case 'enable':
|
||||||
$client = new User($_REQUEST['user_id']);
|
$client = new User($_REQUEST['user_id']);
|
||||||
$client->enable();
|
$client->enable();
|
||||||
show_confirmation(_('User Enabled'),$client->fullname . ' (' . $client->username . ')','admin/users.php');
|
show_confirmation(_('User Enabled'),$client->fullname . ' (' . $client->username . ')', Config::get('web_path'). '/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'),$client->fullname . ' (' . $client->username . ')','admin/users.php');
|
show_confirmation(_('User Disabled'),$client->fullname . ' (' . $client->username . ')', Config::get('web_path'). '/admin/users.php');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
show_confirmation(_('Error'),_('Unable to Disabled last Administrator'),'admin/users.php');
|
show_confirmation(_('Error'),_('Unable to Disabled last Administrator'), Config::get('web_path').'/admin/users.php');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
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']);
|
||||||
require_once Config::get('prefix') . '/templates/show_edit_user.inc.php';
|
require_once Config::get('prefix') . '/templates/show_edit_user.inc.php';
|
||||||
break;
|
break;
|
||||||
case 'confirm_delete':
|
case 'confirm_delete':
|
||||||
if (Config::get('demo_mode')) { break; }
|
if (Config::get('demo_mode')) { break; }
|
||||||
$client = new User($_REQUEST['user_id']);
|
$client = new User($_REQUEST['user_id']);
|
||||||
if ($client->delete()) {
|
if ($client->delete()) {
|
||||||
show_confirmation(_('User Deleted'), "$client->username has been Deleted","admin/users.php");
|
show_confirmation(_('User Deleted'), sprintf(_('%s has been Deleted'), $client->username), Config::get('web_path'). "/admin/users.php");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
show_confirmation(_('Delete Error'), _("Unable to delete last Admin User"),"admin/users.php");
|
show_confirmation(_('Delete Error'), _("Unable to delete last Admin User"), Config::get('web_path')."/admin/users.php");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
case 'delete':
|
||||||
if (Config::get('demo_mode')) { break; }
|
if (Config::get('demo_mode')) { break; }
|
||||||
$client = new User($_REQUEST['user_id']);
|
$client = new User($_REQUEST['user_id']);
|
||||||
show_confirmation(_('Deletion Request'),
|
show_confirmation(_('Deletion Request'),
|
||||||
_('Are you sure you want to permanently delete') . " $client->fullname ($client->username)?",
|
sprintf(_('Are you sure you want to permanently delete %s?'), $client->fullname),
|
||||||
"admin/users.php?action=confirm_delete&user_id=" . $_REQUEST['user_id'],1);
|
Config::get('web_path')."/admin/users.php?action=confirm_delete&user_id=" . $_REQUEST['user_id'],1);
|
||||||
break;
|
break;
|
||||||
/* Show IP History for the Specified User */
|
/* Show IP History for the Specified User */
|
||||||
case 'show_ip_history':
|
case 'show_ip_history':
|
||||||
/* get the user and their history */
|
/* get the user and their history */
|
||||||
$working_user = new User($_REQUEST['user_id']);
|
$working_user = new User($_REQUEST['user_id']);
|
||||||
|
|
||||||
if (!isset($_REQUEST['all'])){
|
if (!isset($_REQUEST['all'])){
|
||||||
$history = $working_user->get_ip_history(0,1);
|
$history = $working_user->get_ip_history(0,1);
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ switch ($_REQUEST['action']) {
|
||||||
require Config::get('prefix') . '/templates/show_ip_history.inc.php';
|
require Config::get('prefix') . '/templates/show_ip_history.inc.php';
|
||||||
break;
|
break;
|
||||||
case 'show_add_user':
|
case 'show_add_user':
|
||||||
if (Config::get('demo_mode')) { break; }
|
if (Config::get('demo_mode')) { break; }
|
||||||
require_once Config::get('prefix') . '/templates/show_add_user.inc.php';
|
require_once Config::get('prefix') . '/templates/show_add_user.inc.php';
|
||||||
break;
|
break;
|
||||||
case 'show_preferences':
|
case 'show_preferences':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue