Beispiel #1
0
 /**
  * Transfer ConfigPress settings
  *
  * @access protected
  */
 protected static function transferConfigPress()
 {
     //transfer ConfigPress first
     $blog = mvb_Model_API::getBlog(1);
     $config = mvb_Model_API::getBlogOption(WPACCESS_PREFIX . 'config_press', '', $blog);
     mvb_Model_ConfigPress::saveConfig($config);
 }
Beispiel #2
0
 public static function saveConfig($config)
 {
     $file = WPACCESS_BASE_DIR . 'config.ini';
     if (is_writable($file) || chmod($file, 0755)) {
         file_put_contents($file, $config);
     }
     //also save to db as backup
     $default_blog = mvb_Model_API::getBlog(1);
     mvb_Model_API::updateBlogOption(WPACCESS_PREFIX . 'config_press', $config, $default_blog);
     //clear cache
     self::$config = NULL;
 }
 /**
  * 
  */
 public function manager_page()
 {
     $c_role = isset($_REQUEST['role']) ? $_REQUEST['role'] : FALSE;
     $c_user = isset($_REQUEST['user']) ? $_REQUEST['user'] : FALSE;
     if (mvb_Model_API::isNetworkPanel()) {
         //require phpQuery
         require_once WPACCESS_BASE_DIR . 'library/phpQuery/phpQuery.php';
         //TODO - I don't like site
         $blog_id = isset($_GET['site']) ? $_GET['site'] : get_current_blog_id();
         $c_blog = mvb_Model_API::getBlog($blog_id);
         $m = new mvb_Model_Manager($this, $c_role, $c_user);
         $m->do_save();
         $params = array('page' => 'wp_access', 'render_mss' => 1, 'site' => $blog_id, 'role' => $c_role, 'user' => $c_user);
         $link = get_admin_url($c_blog->getID(), 'users.php');
         $url = add_query_arg($params, $link);
         $result = mvb_Model_Helper::cURL($url, TRUE, TRUE);
         if (isset($result['content']) && $result['content']) {
             $content = phpQuery::newDocument($result['content']);
             echo $content['#aam_wrap']->htmlOuter();
             unset($content);
         } else {
             wp_die(mvb_Model_Label::get('LABEL_145'));
         }
     } else {
         $m = new mvb_Model_Manager($this, $c_role, $c_user);
         $m->do_save();
         $m->manage();
     }
 }
 /**
  *
  */
 public function accessManagerPage()
 {
     $c_role = mvb_Model_Helper::getParam('current_role', 'REQUEST');
     $c_user = mvb_Model_Helper::getParam('current_user', 'REQUEST');
     if (mvb_Model_API::isNetworkPanel()) {
         //TODO - I don't like site
         $blog_id = isset($_GET['site']) ? $_GET['site'] : get_current_blog_id();
         $c_blog = mvb_Model_API::getBlog($blog_id);
         $m = new mvb_Model_Manager($this, $c_role, $c_user);
         $error = $m->do_save();
         $params = array('page' => 'wp_access', 'render_mss' => 1, 'site' => $blog_id, 'show_message' => isset($_POST['submited']) && is_null($error) ? 1 : 0, 'current_role' => $c_role, 'current_user' => $c_user);
         $link = get_admin_url($c_blog->getID(), 'admin.php');
         $url = add_query_arg($params, $link);
         $result = mvb_Model_Helper::cURL($url, TRUE, TRUE);
         if (isset($result['content']) && $result['content']) {
             $content = phpQuery::newDocument($result['content']);
             if ($error) {
                 //TODO
                 $content['.plugin-notification']->append('<p>' . mvb_Model_Label::get('LABEL_167') . ' <a href="' . WPACCESS_ERROR167_URL . '" target="_blank">' . mvb_Model_Label::get('LABEL_168') . '</a></p>');
             }
             echo $content['#aam_wrap']->htmlOuter();
             unset($content);
         } else {
             wp_die(mvb_Model_Label::get('LABEL_145'));
         }
     } else {
         $m = new mvb_Model_Manager($this, $c_role, $c_user);
         $m->do_save();
         $m->manage();
     }
 }