Exemple #1
0
 protected static function createFilebrowserAccess($userOrRole, $name, $path, $write = true)
 {
     $fba = new FilebrowserAccess();
     $fba->setName($name);
     if ($userOrRole instanceof User) {
         $fba->setUser($userOrRole);
     } else {
         if ($userOrRole instanceof UserRole) {
             $fba->setUserRole($userOrRole);
         }
     }
     $fba->setPath($path);
     $fba->setWrite($write);
     @mkdir(Curry_Util::path(Curry_Core::$config->curry->wwwPath, $path), 0777, true);
     return $fba;
 }
Exemple #2
0
 /**
  * @param \User|\UserRole $userOrRole
  * @param $name
  * @param $path
  * @param bool $write
  * @return \FilebrowserAccess
  * @throws \Exception
  */
 protected static function createFilebrowserAccess($userOrRole, $name, $path, $write = true)
 {
     $fba = new \FilebrowserAccess();
     $fba->setName($name);
     if ($userOrRole instanceof \User) {
         $fba->setUser($userOrRole);
     } else {
         if ($userOrRole instanceof \UserRole) {
             $fba->setUserRole($userOrRole);
         }
     }
     $fba->setPath($path);
     $fba->setWrite($write);
     @mkdir(PathHelper::path(\Curry\App::getInstance()['wwwPath'], $path), 0777, true);
     return $fba;
 }