summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6de3045)
raw | patch | inline | side by side (parent: 6de3045)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 20 Jul 2006 07:23:14 +0000 (07:23 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 20 Jul 2006 07:23:14 +0000 (07:23 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4248 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/personal/generic/class_user.inc | patch | blob | history | |
plugins/personal/generic/main.inc | patch | blob | history |
index c5e234be377037f497a6524c5b61454f9a01f546..471117145c03cac19196f36dbcc1ad660dae88d6 100644 (file)
var $last_pw_storage= "unset";
var $had_userCertificate= FALSE;
+ var $MyAccount_mode = false;
+ var $edit_mode = false;
+
/* attribute list for save action */
var $attributes= array("sn", "givenName", "uid", "personalTitle", "academicTitle",
"homePostalAddress", "homePhone", "labeledURI", "o", "ou", "dateOfBirth", "gender","preferredLanguage",
}
/* Remove picture? */
- if($this->acl_is_writeable("userPicture")) {
+ if($this->acl_is_writeable("userPicture",($this->MyAccount_mode && !$this->edit_mode))) {
if (isset($_POST['picture_remove'])){
$this->jpegPhoto= "*removed*";
$this->set_picture ("./images/default.jpg");
/* Remove certificate? */
- if($this->acl_is_writeable("Certificate")){
+ if($this->acl_is_writeable("Certificate",($this->MyAccount_mode && !$this->edit_mode))){
foreach (array ("userCertificate", "userSMIMECertificate", "userPKCS12") as $val){
if (isset($_POST["remove_$val"])){
}
/* Upload new cert and close dialog? */
- if($this->acl_is_writeable("Certificate")){
+ if($this->acl_is_writeable("Certificate",($this->MyAccount_mode && !$this->edit_mode))){
if (isset($_POST['cert_edit_finish'])){
/* for all certificates do */
/* Display cert dialog */
if ($this->cert_dialog){
- $smarty->assign("CertificateACL",$this->getacl("Certificate"));
+ $smarty->assign("CertificateACL",$this->getacl("Certificate",($this->MyAccount_mode && !$this->edit_mode)));
$smarty->assign("Certificate_readable",$this->acl_is_readable("Certificate"));
foreach(array("userCertificate", "userSMIMECertificate", "userPKCS12") as $cert){
$ui =get_userinfo();
foreach($this->attributes as $val){
$smarty->assign("$val", $this->$val);
- $smarty->assign("$val"."ACL", $this->getacl($val));
+ $smarty->assign("$val"."ACL", $this->getacl($val,($this->MyAccount_mode && !$this->edit_mode)));
}
$smarty->assign("pwmode", $hashes);
$smarty->assign("pwmode_select", $this->pw_storage);
- $smarty->assign("passwordStorageACL", $this->getacl("userPassword"));
+ $smarty->assign("passwordStorageACL", $this->getacl("userPassword",($this->MyAccount_mode && !$this->edit_mode)));
$smarty->assign("base_select", $this->base);
- $smarty->assign("CertificatesACL", $this->getacl("Certificate"));
- $smarty->assign("userPictureACL", $this->getacl("userPicture"));
- $smarty->assign("userPicture_is_readable", $this->acl_is_readable("userPicture"));
+ $smarty->assign("CertificatesACL", $this->getacl("Certificate",($this->MyAccount_mode && !$this->edit_mode)));
+ $smarty->assign("userPictureACL", $this->getacl("userPicture",($this->MyAccount_mode && !$this->edit_mode)));
+ $smarty->assign("userPicture_is_readable", $this->acl_is_readable("userPicture",($this->MyAccount_mode && !$this->edit_mode)));
/* Create base acls */
- $baseACL = $this->getacl("base");
+ $baseACL = $this->getacl("base",($this->MyAccount_mode && !$this->edit_mode));
if(!$this->acl_is_moveable()) {
$baseACL = preg_replace("/w/","",$baseACL);
}
/* Show us the edit screen */
@$smarty->assign("bases", $this->allowedBasesToMoveTo());
-# $smarty->assign("bases", $this->config->idepartments);
+ # $smarty->assign("bases", $this->config->idepartments);
/* Save government mode attributes */
$smarty->assign("ivbbmodes", $ivbbmodes);
foreach ($this->govattrs as $val){
$smarty->assign("$val", $this->$val);
- $smarty->assign("$val"."ACL", $this->getacl($val));
+ $smarty->assign("$val"."ACL", $this->getacl($val,($this->MyAccount_mode && !$this->edit_mode)));
}
} else {
$smarty->assign("governmentmode", "false");
}
/* Special mode for uid */
- $uidACL= $this->getacl("uid");
+ $uidACL= $this->getacl("uid",($this->MyAccount_mode && !$this->edit_mode));
if (isset ($this->dn)){
if ($this->dn != "new"){
$uidACL= preg_replace("/w/","",$uidACL);
/* Save government mode attributes */
if ($this->config->current['GOVERNMENTMODE']){
foreach ($this->govattrs as $val){
- if ($this->acl_is_writeable($val) && isset ($_POST["$val"])){
+ if ($this->acl_is_writeable($val,($this->MyAccount_mode && !$this->edit_mode)) && isset ($_POST["$val"])){
$data= stripcslashes($_POST["$val"]);
if ($data != $this->$val){
$this->is_modified= TRUE;
if ($this->dn == "new" && !$this->acl_is_createable()){
$message[]= _("You have no permissions to create a user on this 'Base'.");
} elseif ($this->dn != $new_dn && $this->dn != "new"){
- if (!$this->acl_is_writeable($this->dn, "user","create")){
+ if (!$this->acl_is_writeable($this->dn, "user","create",($this->MyAccount_mode && !$this->edit_mode))){
$message[]= _("You have no permissions to move a user from the original 'Base'.");
}
}
/* must: sn, givenName, uid */
- if ($this->sn == "" && ($this->acl_is_writeable($this->dn, "user","sn") || ($this->new))){
+ if ($this->sn == "" && ($this->acl_is_writeable("sn",($this->MyAccount_mode && !$this->edit_mode)) || ($this->new))){
$message[]= _("The required field 'Name' is not set.");
}
/* In template mode, the uid and givenName are autogenerated... */
if (!$this->is_template){
- if ($this->givenName == "" && $this->acl_is_writeable("givenName")){
+ if ($this->givenName == "" && $this->acl_is_writeable("givenName",($this->MyAccount_mode && !$this->edit_mode))){
$message[]= _("The required field 'Given name' is not set.");
}
- if ($this->uid == "" && $this->acl_is_writeable("uid")){
+ if ($this->uid == "" && $this->acl_is_writeable("uid",($this->MyAccount_mode && !$this->edit_mode))){
$message[]= _("The required field 'Login' is not set.");
}
if (!(isset($this->config->current['DNMODE']) && $this->config->current['DNMODE'] == "uid")){
/* Load picture from file to object */
function set_picture($filename)
{
- if($this->acl_is_writeable("userPicture")) {
+ if($this->acl_is_writeable("userPicture",($this->MyAccount_mode && !$this->edit_mode))) {
if (!is_file($filename)){
$filename= "./images/default.jpg";
$this->jpegPhoto= "*removed*";
/* Load certificate from file to object */
function set_cert($cert, $filename)
{
- if(!$thsi->acl_is_writeable("Certificate")) return;
+ if(!$thsi->acl_is_writeable("Certificate",($this->MyAccount_mode && !$this->edit_mode))) return;
$fd = fopen ($filename, "rb");
if (filesize($filename)>0) {
$this->$cert= fread ($fd, filesize ($filename));
index 9f5544311e152c219866703f795d20c7472ad461..e7c745eea3295cb9c549673bcfbb28a7b1ed3643 100644 (file)
$_SESSION['edit']= TRUE;
}
- /* Adjust acl's to mode */
+ $user->MyAccount_mode = true;
if (isset($_SESSION['edit'])){
- $acl= get_permissions ($ui->dn, $ui->subtreeACL);
- $user->acl= get_module_permission($acl, "user", $ui->dn);
+ $user->edit_mode = true;
} else {
- $acl= get_permissions ($ui->dn, $ui->subtreeACL);
- $editacl= get_module_permission($acl, "user", $ui->dn);
- $user->acl= "#none#";
+ $user->edit_mode = false;
}
/* Perform password change */
$info= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/openlock.png').
"\"> ".$ui->dn." ";
}
- if ($fn == "edit" && isset($editacl) && $editacl != "#none#"){
+ if ($fn == "edit"){
$info.= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png')."\"> ".
_("Click the 'Edit' button below to change informations in this dialog");
$display.= "<input type=submit name=\"$fn\" value=\"$str\">\n";