Esempio n. 1
0
 function set_publicrights($status, $recursion = 1)
 {
     if ($this->is_dir() && $recursion == 1) {
         $this->loadfile();
         foreach ($this->filecontents as $file2set) {
             $file2setobj = new bhfile($file2set['filepath']);
             $file2setobj->set_publicrights($status);
         }
     }
     $publicrows = select_bhdb("aclpublic", array("filepath" => $this->filepath), "");
     if (!empty($publicrows)) {
         update_bhdb("aclpublic", array("status" => $status), array("filepath" => $this->filepath));
     } else {
         insert_bhdb("aclpublic", array("filepath" => $this->filepath, "status" => $status));
     }
 }
Esempio n. 2
0
    if ($_GET['username'] == $bhsession['username']) {
        bh_log($bhlang['error:permissions_self'], "BH_ERROR");
    } else {
        $fileobj->set_userrights($_GET['username'], $_GET['user']);
        bh_log($bhlang['notice:permissions_changed'], "BH_NOTICE");
    }
}
# Group perms change
if (!empty($_GET['group']) || $_GET['group'] === "0") {
    $fileobj->set_grouprights($_GET['groupname'], $_GET['group']);
    bh_log($bhlang['notice:permissions_changed'], "BH_NOTICE");
}
# Public perms change
if ($_GET['public'] === "0" || $_GET['public'] === "1" || $_GET['public'] === "2") {
    # Change the public permissions to whatever was sent
    $fileobj->set_publicrights($_GET['public']);
    # Display the message
    bh_log($bhlang['notice:permissions_changed'], "BH_NOTICE");
}
# Get the users, groups and public permissions
$usersrights = $fileobj->usersrights();
$groupsrights = $fileobj->groupsrights();
$publicrights = $fileobj->publicrights();
# Open the layout
$layoutobj = new bhlayout("sharingfolder");
# Give it the content
$layoutobj->content1 = $usersrights;
$layoutobj->content2 = $groupsrights;
$layoutobj->content3 = $publicrights;
# And the name
$layoutobj->subtitle1 = $bhlang['title:sharing_'] . $filename;