From: hickert Date: Tue, 21 Mar 2006 07:56:24 +0000 (+0000) Subject: Added copy & paste for generic X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e23e0f3849f20a0bd0702b517f4c330a3ba325dc;p=gosa.git Added copy & paste for generic git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2873 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 1d3e4d4d1..cd0a3a977 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -201,7 +201,7 @@ class user extends plugin /* Put gender attribute to upper case */ if (isset ($this->attrs['gender'])){ $this->gender= strtoupper($this->attrs['gender'][0]); - } + } } @@ -1224,10 +1224,95 @@ class user extends plugin } + function getCopyDialog() + { + $str = ""; + $_SESSION['binary'] = $this->photoData; + $_SESSION['binarytype']= "image/jpeg"; + + /* Get random number for pictures */ + srand((double)microtime()*1000000); + $rand = rand(0, 10000); + + $str = " + + + + + +
+

"._("User settings")."

+ + + + + + + + + + + + + + + + + + +
sn."\">
givenName."\">
uid."\">
+ + "._("User picture")." + + +   + +
+
+ + + + + +
+ + + + +
+ \""._("Personal +
+
+
+ + "; + return($str); + } + + function saveCopyDialog() + { + if((isset($_FILES['picture_file']['tmp_name'])) && ($_FILES['picture_file']['size'] > 0)){ + $this->set_picture($_FILES['picture_file']['tmp_name']); + echo "changed"; + } + /* Remove picture? */ + if (isset($_POST['picture_remove'])){ + $this->jpegPhoto= "*removed*"; + $this->set_picture ("./images/default.jpg"); + $this->is_modified= TRUE; + } + $attrs = array("uid","givenName","sn"); + foreach($attrs as $attr){ + if(isset($_POST[$attr])){ + $this->$attr = $_POST[$attr]; + } + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/personal/generic/generic_picture.tpl b/plugins/personal/generic/generic_picture.tpl index 008ed40f2..2fe6069e4 100644 --- a/plugins/personal/generic/generic_picture.tpl +++ b/plugins/personal/generic/generic_picture.tpl @@ -1,17 +1,13 @@ - - - - - +

{t}Personal picture{/t}