summaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-09-07 04:28:33 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-09-07 04:28:33 +0000
commit0a9fcb0298a4febc6287c77d29929a1cb833eb8b (patch)
treea2490a7d89e60c225141728e7102d20dd5e40e7d /admin
parentbe23e09225cb961e94dbd95c6f394a5d5d7036cb (diff)
downloadampache-0a9fcb0298a4febc6287c77d29929a1cb833eb8b.tar.gz
ampache-0a9fcb0298a4febc6287c77d29929a1cb833eb8b.tar.bz2
ampache-0a9fcb0298a4febc6287c77d29929a1cb833eb8b.zip
fixed stats clearing error
Diffstat (limited to 'admin')
-rw-r--r--admin/catalog.php8
-rw-r--r--admin/users.php19
2 files changed, 20 insertions, 7 deletions
diff --git a/admin/catalog.php b/admin/catalog.php
index c5513284..c3bf3675 100644
--- a/admin/catalog.php
+++ b/admin/catalog.php
@@ -194,8 +194,9 @@ switch ($_REQUEST['action']) {
break;
case 'really_clear_stats':
+
if (conf('demo_mode')) { break; }
- if ($_REQUEST['confrim'] == 'Yes') {
+ if ($_REQUEST['confirm'] == 'Yes') {
clear_catalog_stats();
}
include(conf('prefix') . '/templates/catalog.inc');
@@ -214,15 +215,14 @@ switch ($_REQUEST['action']) {
case 'Clear Catalog':
if (conf('demo_mode')) { break; }
show_confirm_action(_("Do you really want to clear your catalog?"),
- "/admin/catalog.php", "action=really_clear_catalog");
+ "admin/catalog.php", "action=really_clear_catalog");
print("<hr />\n");
break;
case 'clear_stats':
if (conf('demo_mode')) { break; }
show_confirm_action(_("Do you really want to clear the statistics for this catalog?"),
- "/admin/catalog.php", "action=really_clear_stats");
- print("<hr />\n");
+ "admin/catalog.php", "action=really_clear_stats");
break;
case 'show_disabled':
diff --git a/admin/users.php b/admin/users.php
index a48f39e4..4a2f0ed6 100644
--- a/admin/users.php
+++ b/admin/users.php
@@ -118,12 +118,25 @@ switch ($action) {
if (($pass1 !== $pass2)) {
$GLOBALS['error']->add_error('password',_("Error Passwords don't match"));
}
+
if (empty($username)) {
$GLOBALS['error']->add_error('username',_("Error Username Required"));
}
- if (!$user->create($username, $fullname, $email, $pass1, $access)) {
- $GLOBALS['error']->add_error('general',"Error: Insert Failed");
- }
+
+ /* make sure the username doesn't already exist */
+ if (!check_username($username)) {
+ $GLOBALS['error']->add_error('username',_("Error Username already exists"));
+ }
+
+ if (!$GLOBALS['error']->error_state) {
+
+ /* Attempt to create the user */
+ if (!$user->create($username, $fullname, $email, $pass1, $access)) {
+ $GLOBALS['error']->add_error('general',"Error: Insert Failed");
+ }
+
+ } // if no errors
+
/* If we end up with an error */
if ($GLOBALS['error']->error_state) {
show_user_form('','$username','$fullname','$email','$access','new_user','');