Surfbar continued and some rewrites/fixes:
[mailer.git] / inc / modules / member / what-surfbar_book.php
index 97bc955c30e4b6f093c80d9b141920e0f3e98739..977548668f7916a2faa3cd8086f24aed2d7fa67e 100644 (file)
@@ -51,7 +51,7 @@ ADD_DESCR("member", __FILE__);
 if (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
        // No more URLs allowed to book!
        LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SURFBAR_NO_MORE_ALLOWED);
-} elseif (isset($_POST['ok'])) {
+} elseif ((isset($_POST['ok'])) && (isset($_POST['limited']))) {
        // Is limitation "no" and "limit" is > 0?
        if (($_POST['limited'] == "N") && ((isset($_POST['limit'])) && ($_POST['limit'] > 0)) || (!isset($_POST['limit']))) {
                // Set it to unlimited
@@ -61,14 +61,14 @@ if (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
        // Register the new URL
        $insertId = SURFBAR_MEMBER_ADD_URL($_POST['url'], $_POST['limit']);
 
+       // By default something went wrong
+       $msg = MEMBER_SURFBAR_URL_NOT_ADDED;
+
        // Was this fine?
        if ($insertId > 0) {
                // URL added and waiting for unlock
                $msg = MEMBER_SURFBAR_URL_ADDED;
-       } else {
-               // Something went wrong!
-               $msg = MEMBER_SURFBAR_URL_NOT_ADDED;
-       }
+       } // END - if
 
        // Load message template
        LOAD_TEMPLATE("admin_settings_saved", false, $msg);