Changeset 4362 for contrib/Dms/out/out.FolderAccess.php
- Timestamp:
- 05/12/11 11:52:50 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/Dms/out/out.FolderAccess.php
r3526 r4362 13 13 14 14 include("../inc/inc.Authentication.php"); 15 // 15 16 16 17 … … 26 27 27 28 $folderid = (isset($_GET['folderid'])) ? (int) $_GET['folderid'] : NULL; 28 $folder = getFolder($folderid); 29 30 $allUsers = getAllUsers(); 31 32 if ($folder->getAccessMode($user) < M_ALL) 33 die ("Access denied"); 29 //$folder = getFolder($folderid); 30 31 if(!$folder = getFolder($folderid)) { 32 $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); 33 34 } 35 36 if ($folder->getAccessMode($user) < M_READWRITE) 37 $GLOBALS['phpgw']->redirect_link('out/out.ViewFolder.php?error=accesso denegado!'); 38 39 40 //$allUsers = getAllUsers(); 41 //foreach($allUsers as $c=>$v) 42 // echo "<p>El vector con indice $c tiene el valor $v </p>"; 43 //while (list($clave, $valor) = each($allUsers)) { 44 //echo "<p>El vector con indice $clave tiene el valor $valor </p>"; 45 //} 46 //asort($allUsers); 47 //uasort($allUsers,'ordenar'); 48 49 50 51 52 53 $accounts = $GLOBALS['phpgw']->accounts->get_list('accounts'); 54 $allUsers = array(); 55 for ($i = 0; $i < count($accounts); $i++) 56 { 57 $id = $accounts[$i]["account_id"]; 58 $login = $accounts[$i]["account_lid"]; 59 $fullName = $accounts[$i]['account_firstname'].' '.$accounts[$i]['account_lastname']; 60 $email = $accounts[$i]["account_email"]; 61 $isAdmin = phpgw_is_admin($id); 62 $pwd = ''; 63 $comment = ''; 64 //$myCollection->add($id,$login,$fullName,$email,$isAdmin,$pwd,$comment); 65 $allUsers[$i]=new User($id, $login, $pwd, $fullName, $email, $comment, $isAdmin); 66 } 67 //$allUsers->sortDataSet("fullName"); 68 69 70 function cmpNames($a,$b) 71 { 72 //Use sort() for simple alphabetical comparison 73 //Convert to lowercase to ensure consistent behaviour 74 $sortable = array(strtolower($a->_fullName),strtolower($b->_fullName)); 75 $sorted = $sortable; 76 sort($sorted); 77 78 //If the names have switched position, return -1. Otherwise, return 1. 79 return ($sorted[0] == $sortable[0]) ? -1 : 1; 80 } 81 uasort($allUsers, "cmpNames"); 82 83 84 // $allGroups = getAllGroups(); 85 $phpgw_groups = $GLOBALS['phpgw']->accounts->get_list('groups'); 86 87 $allGroups= array(); 88 89 90 for ($i = 0; $i < count($phpgw_groups); $i++) 91 $allGroups[$i] = new Group($phpgw_groups[$i]["account_id"], $phpgw_groups[$i]["account_lid"], ''); 92 93 function cmpNamesg($a,$b) 94 { 95 //Use sort() for simple alphabetical comparison 96 //Convert to lowercase to ensure consistent behaviour 97 $sortable = array(strtolower($a->_name),strtolower($b->_name)); 98 $sorted = $sortable; 99 sort($sorted); 100 101 //If the names have switched position, return -1. Otherwise, return 1. 102 return ($sorted[0] == $sortable[0]) ? -1 : 1; 103 } 104 105 uasort($allGroups, "cmpNamesg"); 106 107 108 //Sort by name: 109 //$myCollection->sortDataSet("fullName"); 110 //print_r($myCollection->dataSet); 111 //$allUsers[]->sortDataSet("fullName"); 112 113 //Sort by x 114 //$myCollection->sortDataSet("login"); 115 //print_r($myCollection->dataSet); 116 117 //Sort by y 118 //$myCollection->sortDataSet("id"); 119 //print_r($myCollection->dataSet); 120 121 //Sort by order added 122 //$myCollection->sortDataSet("added"); 123 //print_r($myCollection->dataSet); 124 125 126 127 //if ($folder->getAccessMode($user) < M_ALL) 128 //die ("Access denied"); 34 129 35 130 … … 58 153 printFolderPageStart($folder); 59 154 printPageHeader(getMLText("edit_folder_access") . ": " . $folder->getName()); 60 61 62 //Nur admin darf Besitzer ändern 155 $owner = $folder->getOwner(); 156 if($user->getID()==1120 ||$owner->getID()==$user->getID()){ 157 158 //Nur admin darf Besitzer ï¿œndern 63 159 if ($user->isAdmin()) 64 160 { … … 112 208 } 113 209 210 if($user->getID()==1120 ){ 114 211 printMLText("does_not_inherit_access_msg", array("inheriturl" => "../op/op.FolderAccess.php?folderid=".$folderid."&action=inherit")); 212 } 115 213 print "</div>"; 116 214 … … 118 216 $accessList = $folder->getAccessList(); 119 217 120 printNextBox(getMLText("default_access")); 121 ?> 122 123 <div class="defaultAccess"> 124 <form action="../op/op.FolderAccess.php"> 125 <input type="Hidden" name="folderid" value="<?php print $folderid;?>"> 126 <input type="Hidden" name="action" value="setdefault"> 127 128 <?php printAccessModeSelection($folder->getDefaultAccess()); ?> 129 <p> 130 <input type="Submit"> 131 </form> 132 </div> 218 //printNextBox(getMLText("default_access")); 219 ?> 220 221 133 222 134 223 <?php … … 227 316 <option value="none">------------------------------- 228 317 <?php 229 $allGroups = getAllGroups();230 318 foreach ($allGroups as $groupObj) 231 319 print "<option value=\"".$groupObj->getID()."\">" . $groupObj->getName() . "\n"; … … 251 339 252 340 printEndBox(); 341 342 253 343 printFolderPageEnd($folder); 344 345 } 254 346 printHTMLFoot(); 255 347 ?>
Note: See TracChangeset
for help on using the changeset viewer.