Ejemplo n.º 1
0
 public function module_uninstall()
 {
     if (isset($_POST['module_uninstall']) && mapi_csrf_check(MGet::string('mapi_csrf'))) {
         $this->model('uninstall_modules');
     }
     $this->module_list();
 }
Ejemplo n.º 2
0
 public function widget_uninstall()
 {
     if (isset($_POST['widget_uninstall']) && mapi_csrf_check(MGet::string('mapi_csrf'))) {
         $this->model('uninstall_widgets');
     }
     $this->widget_list();
 }
Ejemplo n.º 3
0
 public function geocode()
 {
     if (isset($_GET['address']) && mapi_csrf_check(MGet::string('mapi_csrf'))) {
         $result = $this->model('geocode', null, 'majax_geo');
     }
     if ($result) {
         echo json_encode($result);
     }
 }
Ejemplo n.º 4
0
 public function preferences()
 {
     $this->set_page_title('#mappiamo - Preferences');
     if (isset($_POST['preferences_update']) && mapi_csrf_check(MGet::string('mapi_csrf'))) {
         $this->model('update_preferences');
     }
     $preferences = $this->model('get_preferences');
     $this->view('default', $preferences);
 }
Ejemplo n.º 5
0
 public function page_menu()
 {
     $this->set_as_ajax();
     if (isset($_GET['menu_add']) && mapi_csrf_check(MGet::string('mapi_csrf'))) {
         $this->model('add_menu', $this->get_object());
     }
     if (isset($_GET['menu_remove']) && mapi_csrf_check(MGet::string('mapi_csrf'))) {
         $this->model('remove_menu', $this->get_object());
     }
 }
Ejemplo n.º 6
0
 public function profile()
 {
     $this->set_page_title('#mappiamo - Profile');
     if (isset($_POST['profile_update']) && mapi_csrf_check(MGet::string('mapi_csrf'))) {
         $this->model('update_profile');
     }
     if (isset($_POST['change_password']) && mapi_csrf_check(MGet::string('mapi_csrf'))) {
         $this->model('change_password');
     }
     $profile = $this->model('get_profile');
     $this->view('default', $profile);
 }
Ejemplo n.º 7
0
 public function category_delete()
 {
     $this->set_page_title('#mappiamo - Delete category');
     if (isset($_POST['category_delete']) && mapi_csrf_check(MGet::string('mapi_csrf'))) {
         $this->model('delete_category', $this->get_object());
     }
     $category = $this->model('get_category', $this->get_object());
     if ($category) {
         $this->view('delete', $category);
     } else {
         $this->category_list();
     }
 }
Ejemplo n.º 8
0
 public function menu_delete()
 {
     $this->set_page_title('#mappiamo - Delete menu');
     if (isset($_POST['menu_delete']) && mapi_csrf_check(MGet::string('mapi_csrf'))) {
         $this->model('delete_menu', $this->get_object());
     }
     $menu = $this->model('get_menu', $this->get_object());
     if ($menu) {
         $this->view('delete', $menu);
     } else {
         $this->menu_list();
     }
 }
Ejemplo n.º 9
0
 public function user_delete()
 {
     $this->set_page_title('#mappiamo - Delete user');
     if (isset($_POST['user_delete']) && mapi_csrf_check(MGet::string('mapi_csrf'))) {
         $this->model('delete_user', $this->get_object());
     }
     $user = $this->model('get_user', $this->get_object());
     if ($user) {
         $this->view('delete', $user);
     } else {
         $this->user_list();
     }
 }
Ejemplo n.º 10
0
 public function register()
 {
     $reg_allowed = MObject::get('preference', 'registration');
     if ('yes' == $reg_allowed->get_value()) {
         if (isset($_POST['do-register']) && mapi_csrf_check(MGet::string('mapi_csrf'))) {
             $this->model('register');
         }
         if (isset($_GET['activate']) && 1 == $_GET['activate']) {
             $this->model('activate');
         }
         $this->view();
     } else {
         header('Location: ../index.php');
         exit(0);
     }
 }
Ejemplo n.º 11
0
 public function content_import()
 {
     $this->set_page_title('#mappiamo - Import content');
     if (isset($_POST['content_import']) && mapi_csrf_check(MGet::string('mapi_csrf'))) {
         $content = $this->model('import_content');
         if ($content && $content->get_id()) {
             header('Location: index.php?module=mcontent&task=content_edit&object=' . intval($content->get_id()));
             exit(0);
         }
     }
     if (isset($_POST['import_begin'])) {
         $data = $this->model('import', null, 'mcontent_import');
         $this->view('import_results', $data);
     } else {
         $this->view('import');
     }
 }