diff --git a/plugins/personal/connectivity/class_opengwAccount.inc b/plugins/personal/connectivity/class_opengwAccount.inc
index 6b83bdbd6c0e2dd05d49f3f31a2ce9aee7e79c2c..9e9ce7f6dd424053425fcec2e43b2c7172eae901 100644 (file)
var $attributes = array();
var $objectclasses = array();
+ var $SetPassword = false;
+
/* Attribute mapping opengroupware->ldap */
var $attrsToUse = array( "salutation" =>"vocation",
"name" =>"sn",
var $handle = NULL;
var $is_account = false;
var $initialy_was_account = false;
+ var $OGWPassword = "";
function opengwAccount ($config, $dn= NULL)
{
$smarty->assign($ar,array());
}
$smarty->assign("OGWstate"," disabled ");
- foreach(array("LocationTeam","TemplateUser","is_locked","validTeams","opengwAccount","is_account") as $ar){
+ foreach(array("LocationTeam","TemplateUser","is_locked","validTeams","opengwAccount","is_account","OGWPassword") as $ar){
$smarty->assign($ar,"");
$smarty->assign($ar."CHK","");
$smarty->assign($ar."ACL"," disabled ");
/* Show main page */
$smarty->assign("OGWstate"," disabled ");
- foreach(array("LocationTeam","TemplateUser","is_locked","validTeams","opengwAccount") as $ar){
+ foreach(array("LocationTeam","TemplateUser","is_locked","validTeams","opengwAccount","OGWPassword") as $ar){
$smarty->assign($ar."ACL",chkacl($this->acl,$ar));
}
}
}
+ if($this->SetPassword == false){
+ if($_SESSION['js'] == 1){
+ $smarty->assign("OGWPasswordACL"," disabled ");
+ }else{
+ $smarty->assign("OGWPasswordACL","");
+ }
+ $smarty->assign("OGWPassword","");
+ $smarty->assign("OGWPasswordCHK"," ");
+ }else{
+ $smarty->assign("OGWPasswordACL","");
+ $smarty->assign("OGWPassword",$this->OGWPassword);
+ $smarty->assign("OGWPasswordCHK"," checked ");
+ }
$display.= $smarty->fetch (get_template_path('opengw.tpl', TRUE, dirname(__FILE__)));
return ($display);
}
/* get post data */
if($this->is_account){
+ if(isset($_POST['SetPassword'])){
+ $this->SetPassword =true;
+ }else{
+ $this->SetPassword = false;
+ }
+
+ if((isset($_POST['OGWPassword']))&&($this->SetPassword)){
+ $this->OGWPassword = $_POST['OGWPassword'];
+ $pwd = new passwordMethodCrypt($this->config);
+
+ $this->info['password'] = preg_replace("/^{crypt}/","",$pwd->generate_hash($_POST['OGWPassword']));
+ }else{
+ if(isset($this->info['password'])){
+ unset($this->info['password']);
+ }
+ }
+
/* Get selected team chkboxes */
$this->info['TeamIDis'] = array();
foreach($_POST as $name => $value ){