15 include_once (
"FDL/Class.Doc.php");
16 include_once (
"FDL/Lib.Dir.php");
23 print "Database not found : appl->dbaccess";
29 $usage->setDefinitionText(
"Update usercard");
31 $fbar =
$usage->addOptionalParameter(
"bar",
"for progress bar");
38 $query->AddQuery(
"id=$whatid");
40 $query->order_by =
"accounttype desc,id";
49 printf(
"\n%d user to update\n", count(
$table1));
58 $title = strtolower($v[
"lastname"] .
" " . $v[
"firstname"]);
67 $foundoc = $udoc->isAlive();
72 if ($v[
"accounttype"] ==
"G") {
74 "us_whatid = '" . $v[
"id"] .
"'"
79 "us_whatid = '" . $v[
"id"] .
"'"
84 if (count(
$tdoc) > 0) {
87 $foundoc = $udoc->isAlive();
94 if (method_exists($udoc,
"RefreshGroup")) $udoc->RefreshGroup();
95 else if (method_exists($udoc,
"RefreshDocUser")) $udoc->RefreshDocUser();
99 $err = $udoc->modify();
103 printf(_(
"%s updated\n") , $udoc->title);
108 if ($mail !=
"")
$filter = array(
109 "us_mail = '" . pg_escape_string($mail) .
"'"
112 "lower(title) = '" . pg_escape_string(
$title) .
"'"
115 if (count(
$tdoc) > 0) {
116 if (count(
$tdoc) > 1) {
117 printf(_(
"find %s more than one, created aborded\n") ,
$title);
124 $udoc->setValue(
"US_WHATID", $v[
"id"]);
126 $udoc->RefreshDocUser();
130 printf(_(
"%s updated\n") ,
$title);
135 if ($v[
"accounttype"] ==
"G") {
137 $iuser->setValue(
"US_WHATID", $v[
"id"]);
143 printf(_(
"%s igroup created\n") ,
$title);
146 $iuser->setValue(
"US_WHATID", $v[
"id"]);
147 $err = $iuser->Add();
153 printf(_(
"%s iuser created\n") ,
$title);
156 printf(_(
"%s iuser aborded\n") ,
$title);
164 if (($v[
"fid"] == 0) && ($fid > 0)) {
165 $u =
new Account(
"", $v[
"id"]);
174 $doc->exec_query(
"update doc127 set name='GADMIN' where us_whatid='4'");
175 $doc->exec_query(
"update doc127 set name='GDEFAULT' where us_whatid='2'");
176 $doc->exec_query(
"update doc128 set name='USER_ADMIN' where us_whatid='1'");
177 $doc->exec_query(
"update doc128 set name='USER_GUEST' where us_whatid='3'");
178 $doc->exec_query(
"update doc128 set cvid=508 where us_whatid='1'");
179 $doc->exec_query(
"update doc128 set cvid=508 where us_whatid='3'");
getMailAddr($userid, $full=false)
wbar($reste, $total, $text="", $fbar=false)
createDoc($dbaccess, $fromid, $control=true, $defaultvalues=true, $temporary=false)
internalGetDocCollection($dbaccess, $dirid, $start="0", $slice="ALL", $sqlfilters=array(), $userid=1, $qtype="LIST", $fromid="", $distinct=false, $orderby="title", $latest=true, $trash="", &$debug=null, $folderRecursiveLevel=2, $join= '',\SearchDoc &$searchDoc=null)
getFamIdFromName($dbaccess, $name)
new_Doc($dbaccess, $id= '', $latest=false)
if($file) if($subject==""&&$file) if($subject=="") $err
Verify arguments for wsh programs.