summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9cc2e98)
raw | patch | inline | side by side (parent: 9cc2e98)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 3 Nov 2006 05:45:33 +0000 (05:45 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 3 Nov 2006 05:45:33 +0000 (05:45 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5000 594d385d-05f5-0310-b6e9-bd551577e9d8
index 642676dc054863b760191d3606c19eedc6d88944..359b7f848d1c0af887e703dc0906bb510541bfad 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
*/
function execute()
{
+ $_SESSION['errors'] .= "<div><b>".get_class($this)."</b> - ";
+ $_SESSION['errors'] .= "<font face='courier' color='red' >ACL BASE: ".$this->acl_base."</font>";
+ $_SESSION['errors'] .= "<font face='courier' color='blue'>ACL CAT: ".$this->acl_category."</font></div>";
+
/* This one is empty currently. Fabian - please fill in the docu code */
$_SESSION['current_class_for_help'] = get_class($this);
/* Reset Lock message POST/GET check array, to prevent perg_match errors*/
diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc
index d118a64c07630a73585739cf6048bb248b56472c..6d005b802f39f51495cfdf8a4717083e90824799 100644 (file)
/* Dialog attributes */
var $usertab = NULL;
var $ui = NULL;
- var $acl = "";
var $templates = array();
var $got_uid = false;
var $CopyPasteHandler = NULL;
$this->usertab->current = $s_tab;
/* Set ACL and move DN to the headline */
- $this->usertab->set_acl_base();
+ $this->usertab->set_acl_base($this->dn);
$_SESSION['objectinfo']= $this->dn;
}
/* Load permissions for selected 'dn' and check if
we're allowed to remove this 'dn' */
- $ui = get_userinfo();
- if (preg_match("/w/",$ui->get_permissions($this->dn,"users/password"))){
+ if (preg_match("/w/",$this->ui->get_permissions($this->dn,"users/password"))){
/* User is allowed to change passwords, save 'dn' and 'acl' for next
dialog. */
if (isset($_POST['password_finish'])){
/* For security reasons, check if user is allowed to set password again */
- $ui = get_userinfo();
$dn = $this->usertab->dn;
- $acl = $ui->get_permissions($dn, "users/password");
- $cacl= $ui->get_permissions($dn, "users/user");
+ $acl = $this->ui->get_permissions($dn, "users/password");
+ $cacl= $this->ui->get_permissions($dn, "users/user");
if (preg_match('/w/', $acl) || preg_match('/c/', $cacl)){
/* Some nice guy may send this as POST, so we've to check
for the permissions again. */
- $ui = get_userinfo();
- $acl = $ui->get_permissions($this->dn, "users/user");
+ $acl = $this->ui->get_permissions($this->dn, "users/user");
if (preg_match('/d/', $acl)){
foreach ($this->config->departments as $key => $value){
/* Get acls from different ou's */
- $ui = get_userinfo();
- $acl = $ui->get_permissions("cn=dummy,".$this->DivListUsers->selectedBase,"users/user") ;
+ $acl = $this->ui->get_permissions("cn=dummy,".get_people_ou().$value,"users/user") ;
/* If creation of a new user is allowed, append this template */
- if (preg_match("/r/",$acl)){
+ if (preg_match("/c/",$acl)){
/* Search all templates from the current dn */
$ldap->cd (get_people_ou().$value);
index b4d52568d9c3aec33ce596637d5fd5d1c421d582..aa0f792211713cb51afebc0648182983af5467ff 100644 (file)
/* Add references/acls/snapshots */
$this->addSpecialTabs();
- $this->set_acl_base();
}
function save_object($save_current= FALSE)
index 345c0b79ea1ec5c25f1dba0ca2f6bb3aeafca166..95ca9a76bbe10a05c0e790c22534e4c7f35ecd2e 100644 (file)
/* Special handling for attribute jpegPhote needed, scale image via
image magick to 147x200 pixels and inject resulting data. */
- if ($this->jpegPhoto != "*removed*"){
+ if ($this->jpegPhoto == "*removed*"){
+
+ /* Reset attribute to avoid writing *removed* as value */
+ $this->attrs["jpegPhoto"] = array();
+
+ } else {
/* Fallback if there's no image magick inside PHP */
if (!function_exists("imagick_blob2image")){
$this->attrs["jpegPhoto"] = $output;
}
- } elseif(!$this->is_new) {
- // # FIXME User picture saveing ... seams to work.
- // This should be set to array in all cases ... else we write *removed* into this attribute ...
- $this->attrs["jpegPhoto"] = array();
}
/* Build new dn */
/* Load a jpegPhoto from LDAP, this is going to be simplified later on */
function load_picture()
{
- /* make connection and read jpegPhoto */
- $ds= ldap_connect($this->config->current['SERVER']);
- ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
- if (function_exists("ldap_set_rebind_proc") && isset($this->config->current['RECURSIVE']) && $this->config->current['RECURSIVE'] == "true") {
- ldap_set_option($this->cid, LDAP_OPT_REFERRALS, 1);
- ldap_set_rebind_proc($ds, array(&$this, "rebind"));
- }
-
- if(isset($this->config->current['TLS']) &&
- $this->config->current['TLS'] == "true"){
-
- ldap_start_tls($ds);
- }
-
- $r= ldap_bind($ds);
- $sr= @ldap_read($ds, $this->dn, "jpegPhoto=*", array("jpegPhoto"));
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd ($this->dn);
+ $data = $ldap->get_attribute($this->dn,"jpegPhoto");
+
+ if((!$data) || ($data == "*removed*")){
- /* in case we don't get an entry, load a default picture */
- $this->set_picture ("./images/default.jpg");
- $this->jpegPhoto= "*removed*";
+ /* In case we don't get an entry, load a default picture */
+ $this->set_picture ();//"./images/default.jpg");
+ $this->jpegPhoto= "*removed*";
+ }else{
- /* fill data from LDAP */
- if ($sr) {
- $ei=ldap_first_entry($ds, $sr);
- if ($ei) {
- if ($info = ldap_get_values_len($ds, $ei, "jpegPhoto")){
- $this->photoData= $info[0];
- $_SESSION['binary']= $this->photoData;
- $_SESSION['binarytype']= "image/jpeg";
- $this->jpegPhoto= "";
- }
- }
+ /* Set picture */
+ $this->photoData= $data;
+ $_SESSION['binary']= $this->photoData;
+ $_SESSION['binarytype']= "image/jpeg";
+ $this->jpegPhoto= "";
}
-
- /* close conncetion */
- ldap_unbind($ds);
}