Ejemplo n.º 1
0
 function replace_admin_actions()
 {
     global $config, $lang;
     require_once $config['basepath'] . '/include/login.inc.php';
     $login = new login();
     $login_status = $login->loginCheck('Agent');
     if ($login_status !== true) {
         // Run theese commands even if not logged in.
         $data = '';
         switch ($_GET['action']) {
             case 'send_forgot':
                 require_once $config['basepath'] . '/include/login.inc.php';
                 $data = login::forgot_password();
                 break;
             case 'forgot':
                 require_once $config['basepath'] . '/include/login.inc.php';
                 $data = login::forgot_password_reset();
                 break;
             default:
                 $data .= $login_status;
                 break;
         }
     } else {
         switch ($_GET['action']) {
             case 'index':
                 require_once $config['basepath'] . '/include/admin.inc.php';
                 $admin = new general_admin();
                 $data = $admin->index_page();
                 break;
             case 'edit_page':
                 require_once $config['basepath'] . '/include/editor.inc.php';
                 $listing = new editor();
                 $data = $listing->page_edit();
                 break;
             case 'edit_user_images':
                 require_once $config['basepath'] . '/include/images.inc.php';
                 $images = new image_handler();
                 $data = $images->edit_user_images();
                 break;
             case 'edit_listing_images':
                 require_once $config['basepath'] . '/include/images.inc.php';
                 $images = new image_handler();
                 $data = $images->edit_listing_images();
                 break;
             case 'edit_vtour_images':
                 require_once $config['basepath'] . '/include/images.inc.php';
                 $images = new image_handler();
                 $data = $images->edit_vtour_images();
                 break;
             case 'edit_listing_files':
                 require_once $config['basepath'] . '/include/files.inc.php';
                 $files = new file_handler();
                 $data = $files->edit_listing_files();
                 break;
             case 'edit_user_files':
                 require_once $config['basepath'] . '/include/files.inc.php';
                 $files = new file_handler();
                 $data = $files->edit_user_files();
                 break;
             case 'add_listing':
                 require_once $config['basepath'] . '/include/listing_editor.inc.php';
                 $listing_editor = new listing_editor();
                 $data = $listing_editor->add_listing();
                 break;
             case 'edit_my_listings':
                 require_once $config['basepath'] . '/include/listing_editor.inc.php';
                 $listing_editor = new listing_editor();
                 $data = $listing_editor->edit_listings();
                 break;
             case 'edit_listings':
                 require_once $config['basepath'] . '/include/listing_editor.inc.php';
                 $listing_editor = new listing_editor();
                 $data = $listing_editor->edit_listings(false);
                 break;
             case 'configure':
                 require_once $config['basepath'] . '/include/controlpanel.inc.php';
                 $listing_editor = new configurator();
                 $data = $listing_editor->show_configurator();
                 break;
             case 'edit_listing_template':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->edit_listing_template();
                 break;
             case 'edit_listings_template_field_order':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->edit_listings_template_field_order();
                 break;
             case 'edit_agent_template_field_order':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->edit_template_field_order($type = 'agent');
                 break;
             case 'edit_member_template_field_order':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->edit_template_field_order($type = 'member');
                 break;
             case 'edit_agent_template_add_field':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->add_user_template_field($type = 'agent');
                 break;
             case 'edit_member_template_add_field':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $type = 'member';
                 $data = $listing->add_user_template_field($type);
                 break;
             case 'edit_listing_template_search':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->edit_listing_template_search();
                 break;
             case 'edit_listing_template_search_results':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->edit_listing_template_search_results();
                 break;
             case 'user_manager':
                 require_once $config['basepath'] . '/include/user_manager.inc.php';
                 $user_managment = new user_managment();
                 $data = $user_managment->show_user_manager();
                 break;
             case 'edit_user_template':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->edit_user_template();
                 break;
             case 'edit_listing_template_add_field':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->add_listing_template_field();
                 break;
             case 'add_page':
                 require_once $config['basepath'] . '/include/editor.inc.php';
                 $listing = new editor();
                 $data = $listing->add_page();
                 break;
             case 'view_log':
                 require_once $config['basepath'] . '/include/log.inc.php';
                 $data = log::view();
                 break;
             case 'clear_log':
                 require_once $config['basepath'] . '/include/log.inc.php';
                 $data = log::clear_log();
                 break;
             case 'show_property_classes':
                 require_once $config['basepath'] . '/include/propertyclass.inc.php';
                 $data = propertyclass::show_classes();
                 break;
             case 'modify_property_class':
                 require_once $config['basepath'] . '/include/propertyclass.inc.php';
                 $data = propertyclass::modify_property_class();
                 break;
             case 'delete_property_class':
                 require_once $config['basepath'] . '/include/propertyclass.inc.php';
                 $data = propertyclass::delete_property_class();
                 break;
             case 'insert_property_class':
                 require_once $config['basepath'] . '/include/propertyclass.inc.php';
                 $data = propertyclass::insert_property_class();
                 break;
             case 'add_listing_property_class':
                 require_once $config['basepath'] . '/include/listing_editor.inc.php';
                 $listing_editor = new listing_editor();
                 $data = $listing_editor->add_listing_logic();
                 break;
                 //Todo Finish Adding Blog Items
             //Todo Finish Adding Blog Items
             case 'edit_blog':
                 require_once $config['basepath'] . '/include/blog_editor.inc.php';
                 $listing = new blog_editor();
                 $data = $listing->blog_edit_index();
                 break;
             case 'edit_blog_post':
                 require_once $config['basepath'] . '/include/blog_editor.inc.php';
                 $listing = new blog_editor();
                 $data = $listing->blog_edit();
                 break;
             case 'add_blog':
                 require_once $config['basepath'] . '/include/blog_editor.inc.php';
                 $listing = new blog_editor();
                 $data = $listing->add_post();
                 break;
             case 'edit_blog_post_comments':
                 require_once $config['basepath'] . '/include/blog_editor.inc.php';
                 $listing = new blog_editor();
                 $data = $listing->edit_post_comments();
                 break;
             case 'addon_manager':
                 require_once $config['basepath'] . '/include/addon_manager.inc.php';
                 $am = new addon_manager();
                 $data = $am->display_addon_manager();
                 break;
             case 'send_notifications':
                 require_once $config['basepath'] . '/include/notification.inc.php';
                 $notify = new notification();
                 $data = $notify->NotifyUsersOfAllNewListings();
                 break;
             default:
                 // Handle Addons
                 $addon_name = array();
                 if (preg_match("/^addon_(.\\S*?)_.*/", $_GET['action'], $addon_name)) {
                     include_once $config['basepath'] . '/addons/' . $addon_name[1] . '/addon.inc.php';
                     $function_name = $addon_name[1] . '_run_action_admin_template';
                     $data = $function_name();
                 }
         }
     }
     return $data;
 }
Ejemplo n.º 2
0
 function modify_property_class()
 {
     global $conn, $config, $lang;
     require_once $config['basepath'] . '/include/misc.inc.php';
     $misc = new misc();
     $display = '';
     if (isset($_GET['id'])) {
         $display .= '<span class="section_header">' . $lang['property_class_editor'] . '</span><br /><br />';
         $display .= '<form action="index.php?action=modify_property_class" method="POST"><fieldset><legend>' . $lang['property_class_update'] . '</legend>';
         $class_id = intval($_GET['id']);
         $sql = 'SELECT class_name, class_rank FROM ' . $config['table_prefix'] . 'class WHERE class_id = ' . $class_id;
         $recordSet = $conn->Execute($sql);
         if (!$recordSet) {
             $misc->log_error($sql);
         }
         while (!$recordSet->EOF) {
             $class_name = $misc->make_db_unsafe($recordSet->fields['class_name']);
             $class_rank = $misc->make_db_unsafe($recordSet->fields['class_rank']);
             $display .= '' . $lang['property_class_name_update'] . '<input type="text" value="' . $class_name . '" name="class_name" />';
             $display .= '' . $lang['property_class_rank_update'] . '<input type="text" value="' . $class_rank . '" name="class_rank" /><input type="hidden" name="class_id" value="' . intval($_GET['id']) . '" />';
             $recordSet->MoveNext();
         }
         $display .= ' <input type="submit" value="' . $lang['submit'] . '" /></fieldset></form>';
     } elseif ($_POST['class_id']) {
         $class_id = $misc->make_db_safe($_POST['class_id']);
         $class_name = $misc->make_db_safe($_POST['class_name']);
         $class_rank = $misc->make_db_safe($_POST['class_rank']);
         $sql = 'UPDATE ' . $config['table_prefix'] . 'class SET class_name = ' . $class_name . ',class_rank = ' . $class_rank . ' WHERE class_id = ' . $class_id;
         $recordSet = $conn->Execute($sql);
         if (!$recordSet) {
             $misc->log_error($sql);
         }
         $display .= '' . $lang['property_class_updated'] . '<br />';
         $display .= propertyclass::show_classes();
     }
     return $display;
 }