Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
user_uedit.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Generated Header (not documented yet)
9  *
10  * @author Anakeen 2000
11  * @version $Id: user_uedit.php,v 1.3 2005/07/08 15:29:51 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage USERS
15  */
16 /**
17  */
18 // ---------------------------------------------------------------
19 // $Id: user_uedit.php,v 1.3 2005/07/08 15:29:51 eric Exp $
20 // $Source: /home/cvsroot/anakeen/freedom/core/Action/Users/user_uedit.php,v $
21 // ---------------------------------------------------------------
22 include_once ("Class.SubForm.php");
23 include_once ("Class.Domain.php");
24 include_once ("Class.MailAccount.php");
25 include_once ("Class.User.php");
26 // -----------------------------------
27 function user_uedit(&$action)
28 {
29  // -----------------------------------
30  // Get all the params
31  $id = $action->user->id; // himself
32  if ($id == 0) $action->exitError(_("the user identification is unknow"));
33 
34  $papp = GetHttpVars("papp", "APPMNG");
35  $paction = GetHttpVars("paction", "PARAM_CUACCOUNT");
36  $pargs = GetHttpVars("pargs", "");
37  // initialise if user group or single user
38  $group = (GetHttpVars("group") == "yes");
39 
40  $tpasswd = array();
41  $tpasswd[0]["passwd"] = "";
42 
43  $tfirstname = array();
44  $tfirstname[0]["firstname"] = "";
45 
46  $user = $action->user;
47 
48  $action->lay->Set("firstname", $user->firstname);
49  $action->lay->Set("lastname", $user->lastname);
50  $action->lay->Set("login", $user->login);
51  $action->lay->Set("expdate", $user->expires > 0 ? strftime("%d/%m/%Y %X", intval($user->expires)) : "no date limit");
52 
53  $dom = new Domain($action->GetParam("CORE_DB") , $user->iddomain);
54  $action->lay->Set("domain", $dom->name);
55 
56  $ug = new Group($action->GetParam("CORE_DB") , $user->id);
57  $ugroup = $ug->groups; // direct group
58  $tab = array();
59  // search user group
60  $tab = array();
61  //
62  while (list($k, $v) = each($ugroup)) {
63  $gu = new User($action->GetParam("CORE_DB") , $v);
64  $tab[$k]["groupid"] = $v;
65  $dom = new Domain($action->GetParam("CORE_DB") , $gu->iddomain);
66  $tab[$k]["groupname"] = "{$gu->login}@{$dom->name}";
67  }
68 
69  $action->lay->SetBlockData("VIEWGROUP", $tab);
70 
71  $action->lay->Set("APP", $papp);
72  $action->lay->Set("ACTION", $paction);
73  $action->lay->Set("ARGS", $pargs);
74 
75  $form = new SubForm("edit");
76  $form->SetParam("firstname");
77  $form->SetParam("lastname");
78  $form->SetParam("passwd");
79  $form->SetParam("id");
80  $form->SetParam("domainid", "", "sel");
81  $action->parent->AddJsCode($form->GetSubJs());
82  $control = $action->GetLayoutFile("user_control.js");
83  $lay = new Layout($control);
84  $action->parent->AddJsCode($lay->gen());
85 }
86 ?>
← centre documentaire © anakeen - published under CC License - Dynacase