Beispiel #1
0
 public function main()
 {
     global $task;
     $isSend = MRequest::int("send", 0);
     $_task = !$task || $task == "default" ? "main" : $task;
     $this->view->add2Menu(MConfigHelper::getMenu());
     $config = MConfig::instance();
     $err = array();
     if ($isSend) {
         $request = $config->request();
         if (!sizeof($request->error)) {
             if (!_FM_IS_DEMO) {
                 $config->mixinAndSave($request->data);
             }
             MPeer::redirect(MURL::_("config", null, "main") . MSaved::url());
         } else {
             $config->mixin($request->data);
             $err = $request->error;
         }
     }
     $this->view->add2Content(MConfigHelper::generate($_task, $config, $err));
 }
Beispiel #2
0
// printPre($GLOBALS['folderAccess']);
// printPre($GLOBALS['folderAccessNames']);
// die();
$GLOBALS['currentMainFolder'] = MRequest::int("selectMyFolder", -1);
if ($GLOBALS['currentMainFolder'] === -1) {
    $GLOBALS['currentMainFolder'] = MPeer::getSessionInfo("currentFolder", 0);
} else {
    MPeer::setSessionInfo("currentFolder", $GLOBALS['currentMainFolder']);
}
if (!array_key_exists($GLOBALS['currentMainFolder'], $GLOBALS['folderAccess'])) {
    $tmp = 0;
    foreach ($GLOBALS['folderAccess'] as $key => $value) {
        $tmp = (int) $key;
        break;
    }
    MPeer::setSessionInfo("currentFolder", $tmp);
    $GLOBALS['currentMainFolder'] = $tmp;
}
if (isset($GLOBALS['folderAccess'][$GLOBALS['currentMainFolder']])) {
    define('_START_FOLDER', $GLOBALS['folderAccess'][$GLOBALS['currentMainFolder']]);
} else {
    die("No such folder found!");
}
define('_ROOTFOLDERID', (int) $GLOBALS['currentMainFolder']);
// Prepaired for further versions of Profiles
define("_FM_USE_FTP", false);
$mimeTypes = MFile::parseData(_FM_HOME_DIR . DS . "data" . DS . "suffix.ini", true, false);
$GLOBALS['mimeTypes'] = $mimeTypes;
//Task
$task = trim(MRequest::cmd('task'));
$GLOBALS['task'] = $task;
Beispiel #3
0
 public function __construct($id = null)
 {
     $this->path = _FM_HOME_DIR . DS . "data" . DS . "rights" . DS;
     if (!isset(self::$tree)) {
         self::$tree = MPeer::getUserGroups($this);
         self::$user = MPeer::getUser();
     }
     if ($id !== null && MFile::isFile($this->path . "rf" . $id . ".php")) {
         $this->load($id);
     } else {
         $this->createClean($id);
     }
     if ($id !== null && $id > -1) {
         $this->rootFolderId = (int) $id;
     }
     $this->calculate($id);
 }
Beispiel #4
0
		),
		// Info
		array(
				//Views
				array("information"),
				// name
				MText::_("information"),
				// URL
				MURL::_("information"),
				// Roots only ?
				0
		)
				
);

$user = MPeer::getUser();

foreach ($mainMenuItems as $menuItem){
	if(!$menuItem[3] || $menuItem[3] && $user->isRoot || _FM_IS_DEMO){
		if(in_array($GLOBALS['view'], $menuItem[0])){
			echo'
			<div class="toLeft"	style="position: relative; display: block; width: auto; margin-top: 2px;">
			<span class="activeTab" id="activeTab">'.$menuItem[1].'</span>
			<img src="' . _FM_HOME_FOLDER . '/images/active-tab-right.png" class="toLeft" />
			</div>
			'."\n";
		}else{
			echo '<a href="'.$menuItem[2].'" class="tabOverlay">'.$menuItem[1].'</a> '."\n";
		}
	}//EOF  allowed to see
}//EOF foreach
 protected function _rightsSave($id = null)
 {
     if ($id === null || $id < 0) {
         MPeer::redirect(MURL::_("rootsandrights", null, "rights"));
     }
     $rights = MRights::getInstance($id);
     $rights->fetchData();
     if (!_FM_IS_DEMO) {
         $rights->save();
     }
     $groupTab = MRequest::int("grouptab", null);
     $gtab = $groupTab !== null ? '&grouptab=' . $groupTab : '';
     $this->view->addPreToContent($_REQUEST);
     MPeer::redirect(MURL::_("rootsandrights", null, "rights") . '&id=' . $id . $gtab . MSaved::url());
 }