__construct() public method

Constructor
public __construct ( $root )
Example #1
0
 /**
  * @param integer $folder_id
  */
 function __construct($folder_id)
 {
     global $user;
     if (is_numeric($folder_id)) {
         parent::__construct($folder_id);
         $this->group_folder = new FolderIsGroupFolder_Access($folder_id);
         $this->group_id = $this->group_folder->get_group_id();
         $group = new Group($this->group_id);
         if ($group->is_user_in_group($user->get_user_id()) == true) {
             if ($this->read_access == false) {
                 $this->data_entity_permission->set_read_permission();
                 if ($this->data_entity_permission->is_access(1)) {
                     $this->read_access = true;
                 }
             }
             if ($this->write_access == false) {
                 $this->data_entity_permission->set_write_permission();
                 if ($this->data_entity_permission->is_access(2)) {
                     $this->write_access = true;
                 }
             }
         }
     } else {
         parent::__construct(null);
         $this->group_folder = null;
         $this->group_id = null;
     }
 }
 /**
  * @param integer $folder_id
  */
 function __construct($folder_id)
 {
     if (is_numeric($folder_id)) {
         global $user;
         parent::__construct($folder_id);
         $this->organisation_unit_folder = new FolderIsOrganisationUnitFolder_Access($folder_id);
         $this->organisation_unit_id = $this->organisation_unit_folder->get_organisation_unit_id();
         $organisation_unit = new OrganisationUnit($this->organisation_unit_id);
         if ($organisation_unit->is_user_in_organisation_unit($user->get_user_id()) == true or $organisation_unit->is_leader_in_organisation_unit($user->get_user_id()) == true or $organisation_unit->is_owner_in_organisation_unit($user->get_user_id()) == true or $organisation_unit->is_quality_manager_in_organisation_unit($user->get_user_id()) == true) {
             if ($this->read_access == false) {
                 $this->data_entity_permission->set_read_permission();
                 if ($this->data_entity_permission->is_access(1)) {
                     $this->read_access = true;
                 }
             }
             if ($this->write_access == false) {
                 $this->data_entity_permission->set_write_permission();
                 if ($this->data_entity_permission->is_access(2)) {
                     $this->write_access = true;
                 }
             }
         }
     } else {
         parent::__construct(null);
         $this->organisation_unit_folder = null;
         $this->organisation_unit_id = null;
     }
 }
Example #3
0
 /**
  * TemporaryFolder constructor.
  */
 public function __construct()
 {
     $path = TMP;
     $path .= Security::hash(mt_rand() . microtime(), 'md5');
     //$mode = '0775'; // ε(     v ゚ω゚) <パーミッションいくつが適切だ?
     $mode = false;
     // とりあえずデフォルトのまま
     register_shutdown_function(array($this, 'delete'));
     parent::__construct($path, true, $mode);
 }
Example #4
0
 /**
  * @param integer $folder_id
  */
 function __construct($folder_id)
 {
     if (is_numeric($folder_id)) {
         parent::__construct($folder_id);
         $this->user_folder = new FolderIsUserFolder_Access($folder_id);
         $this->user_id = $this->user_folder->get_user_id();
     } else {
         parent::__construct(null);
         $this->user_folder = null;
         $this->user_id = null;
     }
 }
Example #5
0
 /**
  * @param integer $folder_id
  */
 function __construct($folder_id)
 {
     if (is_numeric($folder_id)) {
         parent::__construct($folder_id);
         $this->data_entity_permission->set_read_permission();
         if ($this->data_entity_permission->is_access(1)) {
             $this->read_access = true;
         }
     } else {
         parent::__construct(null);
     }
 }
 /**
  * @param integer $folder_id
  */
 function __construct($folder_id)
 {
     if (is_numeric($folder_id)) {
         parent::__construct($folder_id);
         $this->project_status_folder = new ProjectStatusHasFolder_Access($folder_id);
         $this->project_status_id = $this->project_status_folder->get_project_status_id();
         $this->project_id = $this->project_status_folder->get_project_id();
     } else {
         parent::__construct(null);
         $this->project_status_folder = null;
         $this->project_status_id = null;
         $this->project_id = null;
     }
 }
Example #7
0
 /**
  * @param integer $folder_id
  */
 function __construct($folder_id)
 {
     global $user;
     if (is_numeric($folder_id)) {
         parent::__construct($folder_id);
         $this->sample_folder = new SampleHasFolder_Access($folder_id);
         $this->sample_id = $this->sample_folder->get_sample_id();
         if ($this->sample_id) {
             $sample_security = new SampleSecurity($this->sample_id);
             if ($this->get_automatic == false) {
                 $permission_bin = decbin($this->get_permission());
                 $permission_bin = str_pad($permission_bin, 16, "0", STR_PAD_LEFT);
                 $permission_bin = strrev($permission_bin);
             }
             // Read-Access
             if ($this->get_automatic() == true) {
                 if ($sample_security->is_access(1, false)) {
                     $this->read_access = true;
                 } else {
                     $this->read_access = false;
                 }
             } else {
                 if ($permission_bin[8] == "1" and $sample_security->is_access(1, false)) {
                     $this->read_access = true;
                 } else {
                     $this->read_access = false;
                 }
             }
             // Write-Access
             if ($this->get_automatic() == true) {
                 if ($sample_security->is_access(2, false)) {
                     $this->write_access = true;
                 } else {
                     $this->write_access = false;
                 }
             } else {
                 if ($permission_bin[9] == "1" and $sample_security->is_access(2, false)) {
                     $this->write_access = true;
                 } else {
                     $this->write_access = false;
                 }
             }
             // Delete-Access
             if ($user->is_admin() == true) {
                 if ($sample_security->is_access(5, false)) {
                     $this->delete_access = true;
                 } else {
                     $this->delete_access = false;
                 }
             } else {
                 if ($permission_bin[10] == "1" and $user->is_admin() == true) {
                     $this->delete_access = true;
                 } else {
                     $this->delete_access = false;
                 }
             }
             // Control-Access
             if ($user->is_admin() == true) {
                 if ($sample_security->is_access(7, false)) {
                     $this->control_access = true;
                 } else {
                     $this->control_access = false;
                 }
             } else {
                 if ($permission_bin[11] == "1" and $user->is_admin() == true) {
                     $this->control_access = true;
                 } else {
                     $this->control_access = false;
                 }
             }
         }
     } else {
         parent::__construct(null);
         $this->sample_folder = null;
         $this->sample_id = null;
     }
 }
Example #8
0
 /**
  * @param integer $folder_id
  */
 function __construct($folder_id)
 {
     if (is_numeric($folder_id)) {
         parent::__construct($folder_id);
         $this->project_folder = new ProjectHasFolder_Access($folder_id);
         $this->project_id = $this->project_folder->get_project_id();
         if ($this->project_id) {
             $project_security = new ProjectSecurity($this->project_id);
             if ($this->get_automatic == false) {
                 $permission_bin = decbin($this->get_permission());
                 $permission_bin = str_pad($permission_bin, 16, "0", STR_PAD_LEFT);
                 $permission_bin = strrev($permission_bin);
             }
             if ($this->read_access == false) {
                 if ($this->get_automatic() == true) {
                     if ($project_security->is_access(1, false) or $project_security->is_access(2, false)) {
                         $this->read_access = true;
                     }
                 } else {
                     if ($permission_bin[8] == "1" and ($project_security->is_access(1, false) or $project_security->is_access(2, false))) {
                         $this->read_access = true;
                     }
                 }
             }
             if ($this->write_access == false) {
                 if ($this->get_automatic() == true) {
                     if ($project_security->is_access(3, false) or $project_security->is_access(4, false)) {
                         $this->write_access = true;
                     }
                 } else {
                     if ($permission_bin[9] == "1" and ($project_security->is_access(3, false) or $project_security->is_access(4, false))) {
                         $this->write_access = true;
                     }
                 }
             }
             if ($this->delete_access == false) {
                 if ($this->get_automatic() == true) {
                     if ($project_security->is_access(5, false)) {
                         $this->delete_access = true;
                     }
                 } else {
                     if ($permission_bin[10] == "1" and $project_security->is_access(5, false)) {
                         $this->delete_access = true;
                     }
                 }
             }
             if ($this->control_access == false) {
                 if ($this->get_automatic() == true) {
                     if ($project_security->is_access(7, false)) {
                         $this->control_access = true;
                     }
                 } else {
                     if ($permission_bin[11] == "1" and $project_security->is_access(7, false)) {
                         $this->control_access = true;
                     }
                 }
             }
         }
     } else {
         parent::__construct(null);
         $this->project_folder = null;
         $this->project_id = null;
     }
 }