Example #1
0
function show_login_form($HTTP_VARS, $errors = NULL)
{
    global $PHP_SELF;
    echo _theme_header(get_opendb_lang_var('login'), is_show_login_menu_enabled());
    echo "<h2>" . get_opendb_lang_var('login') . "</h2>";
    if (is_not_empty_array($errors)) {
        echo format_error_block($errors);
    }
    echo "<div id=\"loginFormDiv\">";
    if ($HTTP_VARS['rememberMeLogin'] == 'true') {
        echo "<p class=\"rememberMeLoginMessage\">" . get_opendb_lang_var('not_authorized_to_page_login') . "</p>";
    }
    if (strlen($HTTP_VARS['redirect']) > 0) {
        echo "<p class=\"redirectMessage\">" . get_opendb_lang_var('login_redirect_message', array('pageid' => get_page_id($HTTP_VARS['redirect']))) . "</p>";
    }
    echo "<form id=\"loginForm\" action=\"{$PHP_SELF}\" method=\"POST\" name=\"login\">";
    // The user tried to go straight to a menu item with an invalid session.
    // Set a "redirect" variable here so that after we give them a full session
    // we can redirect them back to the page they really wanted.
    if (strlen($HTTP_VARS['redirect']) > 0) {
        echo "<input type=\"hidden\" name=\"redirect\" value=\"" . $HTTP_VARS['redirect'] . "\">";
    }
    echo "<input type=\"hidden\" name=\"op\" value=\"login\">";
    echo "\n<ul>" . "\n<li><label class=\"label\" for=\"uid\">" . get_opendb_lang_var('userid') . "</label>" . "<input type=\"text\" class=\"text\" id=\"uid\" name=\"uid\" value=\"" . $HTTP_VARS['uid'] . "\"></li>" . "\n<li><label class=\"label\" for=\"password\">" . get_opendb_lang_var('password') . "</label>" . "<input type=\"password\" class=\"password\" id=\"passwd\" name=\"passwd\"></li>";
    echo "\n<li><label class=\"label\" for=\"remember\">" . get_opendb_lang_var('remember_me') . "</label>" . "<input type=\"checkbox\" class=\"remember\" id=\"remember\" name=\"remember\" value=\"true\"></li>";
    echo "</ul>" . "\n<input type=\"submit\" class=\"submit\" value=\"" . get_opendb_lang_var('login') . "\">";
    echo "</form>";
    // force uid field focus for login
    echo "\n<script type=\"text/javascript\">\n\t\tdocument.forms['login']['uid'].focus();\n\t</script>";
    if (is_site_enabled() && is_valid_opendb_mailer()) {
        if (strlen($HTTP_VARS['uid']) > 0 && get_opendb_config_var('login', 'enable_new_pwd_gen') !== FALSE && is_user_granted_permission(PERM_CHANGE_PASSWORD, $HTTP_VARS['uid'])) {
            $footer_links_r[] = array(url => $PHP_SELF . "?op=newpassword&uid=" . urlencode($HTTP_VARS['uid']), text => get_opendb_lang_var('forgot_your_pwd'));
        }
        // no point if site disabled, email is not available
        if (get_opendb_config_var('email', 'send_to_site_admin') !== FALSE) {
            $footer_links_r[] = array(text => get_opendb_lang_var('email_administrator'), target => "popup(640,480)", url => "email.php?op=send_to_site_admin&inc_menu=N");
        }
    }
    // Indicate we should show the signup link.
    if (get_opendb_config_var('login.signup', 'enable') !== FALSE) {
        $footer_links_r[] = array(url => "user_admin.php?op=signup", text => get_opendb_lang_var('sign_me_up'));
    }
    echo format_footer_links($footer_links_r);
    echo "</div>";
    echo _theme_footer();
}
Example #2
0
                    db_free_result($addr_results);
                }
                if (is_valid_opendb_mailer() && strlen($user_r['email_addr']) > 0 && is_user_granted_permission(PERM_SEND_EMAIL) && is_user_permitted_to_receive_email($user_r['user_id'])) {
                    $url = 'email.php?' . get_url_string(array('op' => 'send_to_uid', 'uid' => $user_r['user_id'], 'inc_menu' => 'N', 'subject' => ifempty($HTTP_VARS['subject'], get_opendb_lang_var('no_subject'))));
                    $footer_links_r[] = array(url => $url, target => 'popup(640,480)', text => get_opendb_lang_var('send_email'));
                }
                if (is_user_granted_permission(PERM_VIEW_LISTINGS) && $user_r['active_ind'] == 'Y') {
                    $footer_links_r[] = array(url => "listings.php?owner_id=" . $user_r['user_id'], text => get_opendb_lang_var('list_user_items'));
                }
                if (is_user_granted_permission(PERM_ADMIN_USER_LISTING) && is_opendb_session_var('user_listing_url_vars')) {
                    $footer_links_r[] = array(url => "user_listing.php?" . get_url_string(get_opendb_session_var('user_listing_url_vars')), text => get_opendb_lang_var('back_to_user_listing'));
                }
                echo format_footer_links($footer_links_r);
            } else {
                $message = get_opendb_lang_var('user_not_found', array('user_id' => $user_r['user_id']));
                echo _theme_header($message);
                echo "<p class=\"error\">" . $message . "</p>";
                echo _theme_footer();
            }
        } else {
            opendb_not_authorised_page(PERM_VIEW_USER_PROFILE, $HTTP_VARS);
        }
    } else {
        // invalid login, so login instead.
        redirect_login($PHP_SELF, $HTTP_VARS);
    }
} else {
    //if(is_site_enabled())
    opendb_site_disabled();
}
// Cleanup after begin.inc.php
Example #3
0
                    echo "<ul class=\"listingControls\">";
                    if (get_opendb_config_var('listings', 'allow_override_show_item_image') !== FALSE) {
                        echo "<li>" . getToggleControl($PHP_SELF, $HTTP_VARS, get_opendb_lang_var('show_item_image'), 'show_item_image', ifempty($HTTP_VARS['show_item_image'], get_opendb_config_var('listings', 'show_item_image') == TRUE ? 'Y' : 'N')) . "</li>";
                    }
                    echo "<li>" . getItemsPerPageControl($PHP_SELF, $HTTP_VARS) . "</li>";
                    echo "</ul>";
                    echo "<p class=\"listingDate\">" . get_opendb_lang_var('listing_generated', 'datetime', get_localised_timestamp(get_opendb_config_var('listings', 'print_listing_datetime_mask'))) . "</p>";
                    echo format_footer_links($footer_links_r);
                    echo _theme_footer();
                }
                //end if($show_listings)
            } else {
                //no guests allowed!
                opendb_not_authorised_page(PERM_USER_BORROWER, $HTTP_VARS);
            }
        } else {
            //borrow functionality disabled.
            echo _theme_header(get_opendb_lang_var('borrow_not_supported'));
            echo "<p class=\"error\">" . get_opendb_lang_var('borrow_not_supported') . "</p>";
            echo _theme_footer();
        }
    } else {
        // invalid login, so login instead.
        redirect_login($PHP_SELF, $HTTP_VARS);
    }
} else {
    //if(is_site_enabled())
    opendb_site_disabled();
}
// Cleanup after begin.inc.php
require_once "./include/end.inc.php";
Example #4
0
    // make sure it ends in html
    if (is_exists_language($language) && ends_with($page, ".html") && @file_exists("./help/{$language}/{$page}")) {
        return "./help/{$language}/{$page}";
    }
    // else
    return NULL;
}
if (is_site_enabled()) {
    if (is_opendb_valid_session() || is_site_public_access()) {
        echo _theme_header(get_opendb_lang_var('help'), FALSE);
        if (($page_location = validate_opendb_lang_help_page_url($HTTP_VARS['page'])) != NULL) {
            $page_title = get_opendb_lang_var('site_help', 'site', get_opendb_config_var('site', 'title'));
            echo "<h2>" . $page_title . "</h2>";
            // TODO: Add support for topic and subtopic
            include $page_location;
        } else {
            echo _theme_header(get_opendb_lang_var('no_help_available'), FALSE);
            echo "<p class=\"error\">" . get_opendb_lang_var('no_help_available') . "</p>";
        }
        echo _theme_footer();
    } else {
        //not a valid session.
        // invalid login, so login instead.
        redirect_login($PHP_SELF, $HTTP_VARS);
    }
} else {
    //if(is_site_enabled())
    opendb_site_disabled();
}
// Cleanup after begin.inc.php
require_once "./include/end.inc.php";
Example #5
0
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
// This must be first - includes config.php
require_once "./include/begin.inc.php";
if ($_OpendbBrowserSniffer->isBrowserSupported()) {
    $pageTitle = get_opendb_lang_var('browser_supported');
} else {
    $pageTitle = get_opendb_lang_var('browser_not_supported');
}
echo _theme_header($pageTitle, FALSE);
echo "<h1>" . $pageTitle . "</h1>";
if (!$_OpendbBrowserSniffer->isBrowserSupported()) {
    echo "<p class=\"error\">" . get_opendb_lang_var('browser_not_supported_text') . "</p>";
    $supportedBrowsers = array(array('url' => 'http://www.mozilla.com/firefox/', 'icon' => 'firefox.jpg'), array('url' => 'http://www.microsoft.com/windows/products/winfamily/ie/default.mspx', 'icon' => 'icon_ie7.gif'), array('url' => 'http://www.apple.com/safari/', 'icon' => 'safari.png'));
    echo "<ul class=\"browsers\">";
    while (list(, $browser_r) = each($supportedBrowsers)) {
        if (file_exists('./images/browsers/' . $browser_r['icon'])) {
            $browser_r['icon'] = './images/browsers/' . $browser_r['icon'];
        } else {
            $browser_r['icon'] = NULL;
        }
        echo "<li><a href=\"" . $browser_r['url'] . "\" title=\"" . $browser_r['name'] . "\"><img src=\"" . $browser_r['icon'] . "\"></a></li>";
    }
    echo "</ul>";
}
Example #6
0
        return "\n<div id=\"announcements\">" . "<h3>" . get_opendb_lang_var('announcements') . "</h3>" . "\n<ul>" . $buffer . "\n</ul></div>";
    } else {
        return NULL;
    }
}
function display_last_login_block($userid, $lastvisit)
{
    $plugins_r = get_welcome_block_plugin_r();
    if (is_array($plugins_r)) {
        while (list(, $plugin) = each($plugins_r)) {
            $buffer .= renderWelcomeBlockPlugin($plugin, $userid, $lastvisit);
        }
    }
    $buffer .= get_announcements_block();
    return $buffer;
}
if (is_site_enabled()) {
    if (is_opendb_valid_session() || is_site_public_access()) {
        echo _theme_header(get_opendb_lang_var('login'));
        echo display_last_login_block(get_opendb_session_var('user_id'), get_opendb_session_var('login_lastvisit'));
        echo _theme_footer();
    } else {
        // invalid login, so login instead.
        redirect_login($PHP_SELF, $HTTP_VARS);
    }
} else {
    //if(is_site_enabled())
    opendb_site_disabled();
}
// Cleanup after begin.inc.php
require_once "./include/end.inc.php";
Example #7
0
             if ($HTTP_VARS['op'] == 'send_to_uids' && (is_not_empty_array($HTTP_VARS['user_id_rs']) || strlen(trim($HTTP_VARS['checked_user_id_rs_list'])) > 0)) {
                 if ($HTTP_VARS['op2'] == 'send' && send_email_to_userids($HTTP_VARS['user_id_rs'], $from_user_r['user_id'], $HTTP_VARS['subject'], $HTTP_VARS['message'], $errors)) {
                     // do nothing
                 } else {
                     show_email_form(get_user_ids_tovalue($HTTP_VARS['user_id_rs']), get_opendb_lang_var('site_users', 'user_desc', get_opendb_config_var('site', 'title')), $from_user_r['user_id'], $from_user_r['fullname'], $HTTP_VARS['subject'], $HTTP_VARS['message'], $HTTP_VARS, $errors);
                 }
             }
         }
         echo _theme_footer();
     } else {
         opendb_not_authorised_page(PERM_ADMIN_SEND_EMAIL, $HTTP_VARS);
     }
 } else {
     if ($HTTP_VARS['op'] == 'send_to_uid' && is_user_permitted_to_receive_email($HTTP_VARS['uid'])) {
         if (is_user_granted_permission(PERM_SEND_EMAIL)) {
             echo _theme_header(get_opendb_lang_var('send_email'), $HTTP_VARS['inc_menu']);
             echo "<h2>" . get_opendb_lang_var('send_email') . "</h2>";
             $from_user_r = fetch_user_r(get_opendb_session_var('user_id'));
             $HTTP_VARS['toname'] = trim(strip_tags($HTTP_VARS['toname']));
             if ($HTTP_VARS['op2'] == 'send' && send_email_to_userids(array($HTTP_VARS['uid']), $from_user_r['user_id'], $HTTP_VARS['subject'], $HTTP_VARS['message'], $errors)) {
                 // do nothing
             } else {
                 show_email_form($HTTP_VARS['uid'], fetch_user_name($HTTP_VARS['uid']), $from_user_r['user_id'], $from_user_r['fullname'], $HTTP_VARS['subject'], $HTTP_VARS['message'], $HTTP_VARS, $errors);
             }
             echo _theme_footer();
         } else {
             opendb_not_authorised_page(PERM_SEND_EMAIL, $HTTP_VARS);
         }
     } else {
         opendb_operation_not_available();
     }
Example #8
0
/**
 * Will work out based on the $op what the title should be.  It will
 * return a complete heading, including calling the _theme_header
 * and everything.
 */
function do_op_title($item_r, $status_type_r, $op)
{
    global $titleMaskCfg;
    global $HTTP_VARS;
    // hack
    if ($op == 'new' || $op == 'site' || $op == 'site-search' || $op == 'insert') {
        if ($item_r['owner_id'] != get_opendb_session_var('user_id')) {
            $item_title = get_opendb_lang_var('add_new_item_for_name', array('user_id' => $item_r['owner_id'], 'fullname' => fetch_user_name($item_r['owner_id'])));
        } else {
            $item_title = get_opendb_lang_var('add_new_item');
        }
    } else {
        if ($op == 'update' || $op == 'delete' || $op == 'delete_related') {
            $item_title = get_opendb_lang_var($op . '_item');
        } else {
            if ($op == 'refresh' || $op == 'edit' || $op == 'clone_item') {
                if ($op == 'clone_item') {
                    $op = 'clone';
                }
                $item_title = get_opendb_lang_var($op . '_title', array('display_title' => $titleMaskCfg->expand_item_title($item_r)));
            } else {
                if ($op == 'newinstance') {
                    // temporarily remove instance_no so that title renders correctly.
                    $item_r['instance_no'] = NULL;
                    $item_title = get_opendb_lang_var('new_item_instance_title', array('display_title' => $titleMaskCfg->expand_item_title($item_r)));
                }
            }
        }
    }
    echo _theme_header($item_title, $HTTP_VARS['inc_menu']);
    echo "<h2>" . $item_title . " " . get_item_image($item_r['s_item_type']) . "</h2>\n";
}
Example #9
0
function opendb_not_authorised_page($permission = NULL, $HTTP_VARS = NULL)
{
    global $PHP_SELF;
    if ($permission != NULL && is_permission_disabled_for_remember_me($permission)) {
        redirect_login($PHP_SELF, $HTTP_VARS, TRUE);
    } else {
        echo _theme_header(get_opendb_lang_var('not_authorized_to_page'));
        echo "<p class=\"error\">" . get_opendb_lang_var('not_authorized_to_page') . "</p>";
        echo _theme_footer();
    }
}
Example #10
0
     } else {
         //if($importPlugin !== NULL)
         echo _theme_header(get_opendb_lang_var('undefined_error'));
         echo "<p class=\"error\">" . get_opendb_lang_var('undefined_error') . "</p>";
         echo _theme_footer();
     }
 } else {
     // A custom title.
     if (is_user_granted_permission(PERM_ADMIN_EXPORT) && strlen($HTTP_VARS['owner_id']) == 0) {
         $page_title = get_opendb_lang_var('export_items');
     } else {
         if ($HTTP_VARS['owner_id'] == get_opendb_session_var('user_id') || strlen($HTTP_VARS['owner_id']) == 0) {
             $page_title = get_opendb_lang_var('export_my_items');
         }
     }
     echo _theme_header($page_title);
     echo "<h2>" . $page_title . "</h2>";
     echo "<form method=\"GET\" action=\"{$PHP_SELF}\">";
     echo "\n<input type=\"hidden\" name=\"op\" value=\"export\">";
     echo "<table>";
     $field = "\n<select name=\"plugin\">\n";
     $plugin_list_r = get_export_plugin_list_r();
     if (is_array($plugin_list_r)) {
         while (list(, $plugin_r) = @each($plugin_list_r)) {
             $field .= '<option value="' . $plugin_r['name'] . '"';
             if ($plugin_r['name'] == 'OpenDbExportPlugin') {
                 $field .= ' SELECTED';
             }
             $field .= '>' . $plugin_r['description'] . "\n";
         }
     }
Example #11
0
            if (get_opendb_config_var('borrow', 'enable') !== FALSE) {
                echo "<td>" . $sum_reserved . "</td>";
                echo "<td>" . $sum_loaned . "</td>";
            }
            echo "</tr>";
        }
        echo "</table>";
    }
}
if (is_site_enabled()) {
    if (is_opendb_valid_session() || is_site_public_access()) {
        if (is_user_granted_permission(PERM_VIEW_STATS)) {
            if ($HTTP_VARS['op'] == 'graph') {
                do_stats_graph($HTTP_VARS);
            } else {
                echo _theme_header(get_opendb_lang_var('statistics'));
                echo "<h2>" . get_opendb_lang_var('statistics') . "</h2>";
                build_review_stats();
                build_borrower_stats();
                build_item_stats();
                $item_type_rs = get_item_type_totals_rs();
                if (count($item_type_rs) > 0) {
                    echo "<div class=\"tabContainer\">";
                    echo "<ul class=\"tabMenu\" id=\"tab-menu\">";
                    echo "<li id=\"menu-breakdown\" class=\"first activeTab\" onclick=\"return activateTab('breakdown', 'tab-menu', 'tab-content', 'activeTab', 'tabContent')\">" . get_opendb_lang_var('overview') . "</li>";
                    reset($item_type_rs);
                    while (list(, $item_type_r) = each($item_type_rs)) {
                        echo "<li id=\"menu-{$item_type_r['s_item_type']}\" onclick=\"return activateTab('{$item_type_r['s_item_type']}', 'tab-menu', 'tab-content', 'activeTab', 'tabContent')\">{$item_type_r['s_item_type']}</li>";
                    }
                    echo "</ul>";
                    $graphCfg = _theme_graph_config();
Example #12
0
                            }
                            echo _theme_header($page_title);
                            echo "<h2>" . $page_title . "</h2>";
                            echo get_upload_form($HTTP_VARS);
                            echo _theme_footer();
                        }
                    }
                }
            } else {
                // if(is_file_upload_enabled() && import_check_is_installed())
                if (is_file_upload_enabled()) {
                    echo _theme_header(get_opendb_lang_var('import_not_available'));
                    echo "<p class=\"error\">" . get_opendb_lang_var('import_not_available') . "</p>";
                    opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, 'Import cache table not installed.');
                } else {
                    echo _theme_header(get_opendb_lang_var('file_upload_not_available'));
                    echo "<p class=\"error\">" . get_opendb_lang_var('file_upload_not_available') . "</p>";
                }
            }
        } else {
            //not an administrator or own user.
            opendb_not_authorised_page(array(PERM_USER_IMPORT, PERM_ADMIN_IMPORT));
        }
    } else {
        //invalid session
        // invalid login, so login instead.
        redirect_login($PHP_SELF, $HTTP_VARS);
    }
} else {
    //if(is_site_enabled())
    opendb_site_disabled();
Example #13
0
             echo "<div class=\"{$otherTabsClass}\" id=\"instance_info\">";
             echo get_instance_info_block($item_r, $HTTP_VARS, $instance_info_links_r);
             echo get_related_items_block($item_r, $HTTP_VARS, $instance_info_links_r);
             echo format_footer_links($instance_info_links_r);
             echo "</div>";
             if (get_opendb_config_var('item_review', 'enable') !== FALSE) {
                 echo "<div class=\"{$otherTabsClass}\" id=\"reviews\">";
                 echo get_item_review_block($item_r);
                 echo "</div>";
             }
             echo "</div>";
             // end of tab content
             echo "</div>";
             // end of tabContainer
         } else {
             echo _theme_header(get_opendb_lang_var('item_not_found'));
             echo "<p class=\"error\">" . get_opendb_lang_var('item_not_found') . "</p>";
         }
         if (is_export_plugin(get_opendb_config_var('item_display', 'export_link')) && is_user_granted_permission(PERM_USER_EXPORT)) {
             $footer_links_r[] = array(url => "export.php?op=export&plugin=" . get_opendb_config_var('item_display', 'export_link') . "&item_id=" . $item_r['item_id'] . "&instance_no=" . $item_r['instance_no'], text => get_opendb_lang_var('export_item_record'));
         }
         // Include a Back to Listing link.
         if (is_opendb_session_var('listing_url_vars')) {
             $footer_links_r[] = array(url => "listings.php?" . get_url_string(get_opendb_session_var('listing_url_vars')), text => get_opendb_lang_var('back_to_listing'));
         }
         echo format_footer_links($footer_links_r);
         echo _theme_footer();
     } else {
         opendb_not_authorised_page(PERM_VIEW_ITEM_DISPLAY, $HTTP_VARS);
     }
 } else {
Example #14
0
             include_once "./admin/" . $ADMIN_TYPE . "/functions.php";
         }
         if (file_exists("./admin/" . $ADMIN_TYPE . "/ajaxjobs.php")) {
             require_once "./lib/xajax/xajax_core/xajax.inc.php";
             $xajax = new xajax("admin.php?type={$ADMIN_TYPE}");
             $xajax->configure('javascript URI', 'lib/xajax/');
             $xajax->configure('debug', false);
             $xajax->configure('statusMessages', true);
             $xajax->configure('waitCursor', true);
             include_once "./admin/" . $ADMIN_TYPE . "/ajaxjobs.php";
             $xajax->processRequest();
         }
         if ($HTTP_VARS['mode'] != 'job') {
             $menu_option_r = get_system_admin_tools_menu($ADMIN_TYPE);
             $title = $menu_option_r['link'] . " Admin Tool";
             _theme_header($title);
             // todo - this should really be in the <head>...</head> - does it matter?
             if ($xajax) {
                 $xajax->printJavascript();
             }
             echo "<h2>" . $title . "</h2>";
         }
         include_once "./admin/" . $ADMIN_TYPE . "/index.php";
         if ($HTTP_VARS['mode'] != 'job') {
             echo _theme_footer();
         }
     } else {
         //not an administrator or own user.
         opendb_not_authorised_page(PERM_ADMIN_TOOLS, $HTTP_VARS);
     }
 } else {
Example #15
0
                 echo "<input type=\"hidden\" name=\"step\" value=\"install\">\n";
                 echo "<p>Pre install checks have been completed.  Your OpenDb database will now be checked to see if upgrades are required.</p>";
             } else {
                 echo "<input type=\"hidden\" name=\"step\" value=\"pre-install\">\n";
             }
             echo "<input type=\"button\" class=\"button\" value=\"Next\" onclick=\"this.value='Working...'; this.disabled=true; this.form.submit(); return true;\">\n";
             echo "</form>";
         } else {
             echo "<p class=\"error\">There is no support to upgrade from versions of OpenDb prior to 0.80.  You will have to\n\t\t\t\tinstall an older version and upgrade to at least 0.80 first.</p>";
         }
         echo _theme_footer();
     }
 } else {
     // else step = upgrade / install
     @set_time_limit(600);
     echo _theme_header("OpenDb " . get_opendb_version() . " Installation", FALSE);
     $is_new_install = FALSE;
     if (is_db_connected() && is_valid_opendb_release_table() && (!is_opendb_partially_installed() || count_opendb_table_rows('s_opendb_release') > 0)) {
         if (is_opendb_partially_installed()) {
             // upgrade
             if (!check_opendb_version()) {
                 $result = install_opendb_upgrade($HTTP_VARS, $errors);
                 if ($result == FALSE) {
                     echo "<p class=\"error\">The following upgrade errors occurred: </p>";
                     if (is_array($errors)) {
                         echo format_error_block($errors);
                     }
                 } else {
                     if ($result === TRUE && !check_opendb_version()) {
                         echo "<h2>More Upgrades required</h2>";
                         echo "The upgrade was completed successfully.  There are still additional upgrades required.</p>";
Example #16
0
         if ($HTTP_VARS['owner_id'] == get_opendb_session_var('user_id')) {
             $page_title = get_opendb_lang_var('my_item_listing');
         } else {
             if (strlen($HTTP_VARS['owner_id']) > 0) {
                 $page_title = get_opendb_lang_var('item_listing_for_name', array('fullname' => fetch_user_name($HTTP_VARS['owner_id']), 'user_id' => $HTTP_VARS['owner_id']));
             } else {
                 if (strlen($HTTP_VARS['not_owner_id']) > 0) {
                     $page_title = get_opendb_lang_var('other_item_listing');
                 } else {
                     $page_title = get_opendb_lang_var('all_item_listing');
                 }
             }
         }
     }
 }
 echo _theme_header($page_title, $HTTP_VARS['inc_menu']);
 echo '<h2>' . $page_title . '</h2>';
 if ($HTTP_VARS['search_list'] == 'y' || $HTTP_VARS['attribute_list'] == 'y') {
     // default search term if attribute_type specified, but no value provided.
     if (strlen($HTTP_VARS['attribute_type']) > 0 && strlen($HTTP_VARS['attribute_val']) == 0 && strlen($HTTP_VARS['lookup_attribute_val']) == 0) {
         $HTTP_VARS['attribute_val'] = '%';
     }
     if ($HTTP_VARS['show_search_query_matrix'] != 'N') {
         $matrix_rs = get_search_query_matrix($HTTP_VARS);
         if (is_not_empty_array($matrix_rs)) {
             echo '<div class="search-query"><dl>';
             while (list(, $matrix_r) = each($matrix_rs)) {
                 echo '<dt>' . $matrix_r['prompt'] . '</dt>' . '<dd>' . $matrix_r['field'] . '</dd>';
             }
             echo '</dl></div>';
         }
Example #17
0
                                         }
                                     } else {
                                         // $return_val === FALSE
                                         echo format_error_block($errors);
                                         echo get_user_input_form(NULL, $HTTP_VARS);
                                     }
                                 } else {
                                     //is_secretimage_code_valid
                                     echo format_error_block(get_opendb_lang_var('invalid_verify_code'));
                                     echo get_user_input_form(NULL, $HTTP_VARS);
                                 }
                                 echo format_footer_links($footer_links_r);
                                 echo _theme_footer();
                             } else {
                                 $page_title = get_opendb_lang_var('new_account');
                                 echo _theme_header($page_title, is_show_login_menu_enabled());
                                 echo "\n<h2>" . $page_title . "</h2>";
                                 echo get_user_input_form(NULL, $HTTP_VARS);
                                 echo format_footer_links($footer_links_r);
                                 echo _theme_footer();
                             }
                         } else {
                             //End of $HTTP_VARS['op'] checks
                             opendb_operation_not_available();
                         }
                     }
                 }
             }
         }
     }
 }
Example #18
0
        while ($item_instance_r = db_fetch_assoc($result)) {
            $rssout .= "\n\t<item>" . "\n\t\t<title>" . rss_encoded($item_instance_r['title']) . "</title>" . "\n\t\t<link>" . rss_encoded($URL) . "</link>" . "\n\t\t<pubDate>" . get_localised_timestamp($datemask, $item_instance_r['submit_on']) . " " . date('T') . "</pubDate>" . "\n\t\t<guid>" . rss_encoded($URL) . "</guid>" . "\n\t\t<description>" . rss_encoded(nl2br($item_instance_r['content'])) . "</description>" . "\n\t</item>";
        }
        db_free_result($result);
    }
    return $rssout;
}
// Returns text w/o characters that cause problems for xml
function rss_encoded($inString)
{
    return htmlspecialchars($inString);
}
if (is_site_enabled()) {
    if (is_opendb_valid_session() || is_site_public_access()) {
        if (strlen($HTTP_VARS['feed']) == 0) {
            echo _theme_header(get_opendb_lang_var('rss_feeds'));
            echo "<h2>" . get_opendb_lang_var('rss_feeds') . "</h2>";
            $feeds_r = get_opendb_rss_feeds();
            echo "<ul id=\"rssfeeds\">";
            reset($feeds_r);
            while (list(, $feed_r) = each($feeds_r)) {
                echo '<li><a href="' . $PHP_SELF . '?feed=' . $feed_r['feed'] . '">' . $feed_r['title'] . '</a></dd>';
            }
            echo "</ul>";
            echo _theme_footer();
        } else {
            @set_time_limit(600);
            $feed_config_r = get_opendb_rss_feed_config($HTTP_VARS['feed']);
            if (is_not_empty_array($feed_config_r)) {
                $URL = get_site_url();
                $rssoutput = '';