20 include_once (
"FDL/Class.Doc.php");
21 include_once (
"FDL/Lib.Dir.php");
28 print
"Database not found : param FREEDOM_DB";
38 $query->AddQuery(
"id=$whatid");
40 $query->order_by =
"isgroup,id";
49 printf(
"\n%d user to update\n", count(
$table1));
58 $title = strtolower($v[
"lastname"] .
" " . $v[
"firstname"]);
66 $foundoc = $udoc->isAlive();
71 if ($v[
"isgroup"] ==
"Y") {
73 "us_whatid = '" . $v[
"id"] .
"'"
78 "us_whatid = '" . $v[
"id"] .
"'"
83 if (count(
$tdoc) > 0) {
86 $foundoc = $udoc->isAlive();
91 if (method_exists($udoc,
"RefreshGroup")) $udoc->RefreshGroup();
92 else if (method_exists($udoc,
"RefreshDocUser")) $udoc->RefreshDocUser();
96 $err = $udoc->modify();
97 if (
$err !=
"") print
"$err\n";
100 printf(_(
"%s updated\n") , $udoc->title);
105 if ($mail !=
"")
$filter = array(
109 "lower(title) = '" . pg_escape_string(
$title) .
"'"
112 if (count(
$tdoc) > 0) {
113 if (count(
$tdoc) > 1) {
114 printf(_(
"find %s more than one, created aborded\n") ,
$title);
118 "US_WHATID" => $v[
"id"]
121 printf(_(
"%s migrated\n") ,
$title);
125 $udoc->setValue(
"US_WHATID", $v[
"id"]);
127 $udoc->RefreshDocUser();
131 printf(_(
"%s updated\n") ,
$title);
137 if ($v[
"isgroup"] ==
"Y") {
139 $iuser->setValue(
"US_WHATID", $v[
"id"]);
142 $iuser->postmodify();
145 printf(_(
"%s igroup created\n") ,
$title);
148 $iuser->setValue(
"US_WHATID", $v[
"id"]);
149 $err = $iuser->Add();
155 printf(_(
"%s iuser created\n") ,
$title);
158 printf(_(
"%s iuser aborded\n") ,
$title);
166 if (($v[
"fid"] == 0) && ($fid > 0)) {
167 $u =
new User(
"", $v[
"id"]);
176 $doc->exec_query(
"update doc127 set name='GADMIN' where us_whatid=4");
177 $doc->exec_query(
"update doc127 set name='GDEFAULT' where us_whatid=2");