You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(32) |
Sep
|
Oct
|
Nov
(100) |
Dec
(22) |
|---|
|
From: <jhe...@us...> - 2002-11-28 14:52:09
|
Update of /cvsroot/upcase-project/UpCase/templates/en In directory sc8-pr-cvs1:/tmp/cvs-serv25668 Added Files: adminsonly.mxt accessdenied.mxt Log Message: templates for new administrative messages --- NEW FILE: adminsonly.mxt --- <html> <head> <title>Error Message</title> </head> <body> <h1>Only adminstrators are authorized to access this page</h1> </body> </html> --- NEW FILE: accessdenied.mxt --- <html> <head> <title>Error Message</title> </head> <body> <h1>You don't have access to this page</h1> </body> </html> |
|
From: <jhe...@us...> - 2002-11-28 14:51:13
|
Update of /cvsroot/upcase-project/UpCase/templates/en In directory sc8-pr-cvs1:/tmp/cvs-serv24740 Modified Files: category.mxt Log Message: moved support warning block as a block to delete rather than to be added Index: category.mxt =================================================================== RCS file: /cvsroot/upcase-project/UpCase/templates/en/category.mxt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** category.mxt 21 Nov 2002 15:22:30 -0000 1.3 --- category.mxt 28 Nov 2002 14:51:10 -0000 1.4 *************** *** 49,52 **** --- 49,62 ---- <td colspan="2"> <mx:bloc id="support"> + + <p> + <b>Warning !</b> This package is NOT supported by the installer of upcase. That + does not means that you can't install and use it. It simply means that this + package will only be downloaded and unpacked by upcase in the path you specify + in the installer from. All other steps of the install procedure will be handled + by package provided scripts. The uninstall procedure can remove the files that + this package has created, but will NOT remove any data in the database. You + will have to do it manually to get rid of the whole thing. + </p> </mx:bloc id="support"> </td> |
|
From: <jhe...@us...> - 2002-11-28 14:50:01
|
Update of /cvsroot/upcase-project/UpCase/templates/en In directory sc8-pr-cvs1:/tmp/cvs-serv24072 Modified Files: installer.mxt Log Message: removed upgrade button Index: installer.mxt =================================================================== RCS file: /cvsroot/upcase-project/UpCase/templates/en/installer.mxt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** installer.mxt 13 Nov 2002 08:41:31 -0000 1.1 --- installer.mxt 28 Nov 2002 14:49:58 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- <h1>Installing package <mx:text id="pkgname" /></h1> <form mxAttribut="action:installer"> + <mx:hidden id=" <input type="hidden" name="cat" value="<mx:text id="catname" />"> <input type="hidden" name="pkg" value="<mx:text id="pkgname" />"> *************** *** 25,31 **** </tr> <tr> ! <td><input type="submit" value="install" name="install"></td> ! <!-- <td><input type="submit" value="upgrade" name="upgrade"></td> --> ! <td><input type="button" value="cancel" name="cancel"></td> </table> </center> --- 26,32 ---- </tr> <tr> ! <td><input type="submit" value="install"></td> ! <td><input type="button" value="cancel"></td> ! </tr> </table> </center> |
|
From: <jhe...@us...> - 2002-11-28 14:48:53
|
Update of /cvsroot/upcase-project/UpCase/templates/en In directory sc8-pr-cvs1:/tmp/cvs-serv23142 Modified Files: useredit.mxt Log Message: added checkbox for user deletion Index: useredit.mxt =================================================================== RCS file: /cvsroot/upcase-project/UpCase/templates/en/useredit.mxt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** useredit.mxt 13 Nov 2002 08:41:31 -0000 1.2 --- useredit.mxt 28 Nov 2002 14:48:50 -0000 1.3 *************** *** 11,44 **** <tr> ! <td>First Name : </td><td><input type="text" name="firstname" value="<mx:text id="firstname" />"></td> </tr> <tr> ! <td>Last Name : </td><td><input type="text" name="lastname" ! value="<mx:text id="lastname" />"></td> </tr> <tr> ! <td>E-Mail : </td><td><input type="text" name="email" ! value="<mx:text id="email" />"></td> </tr> <tr> ! <td>Group : </td><td><mx:select id="primarygroup" /></td> </tr> <tr> ! <td>Additional groups : </td><td><mx:select id="secondarygroups" /></td> </tr> <tr> ! <td>Password : </td><td><input type=text name="password" /></td> </tr> <tr> ! <td>Preferred language : </td><td><mx:select id="preflang" /></td> <tr> ! <td colspan="2"><input type="submit" value="Apply Changes" /></td></tr> </table> --- 11,58 ---- <tr> ! <td>First Name : </td> ! <td><input type="text" name="firstname" value="<mx:text id="firstname" />"></td> </tr> <tr> ! <td>Last Name : </td> ! <td><input type="text" name="lastname" ! value="<mx:text id="lastname" />"></td> </tr> <tr> ! <td>E-Mail : </td> ! <td><input type="text" name="email" value="<mx:text id="email" />"></td> </tr> <tr> ! <td>Group : </td> ! <td><mx:select id="primarygroup" /></td> </tr> <tr> ! <td>Additional groups : </td> ! <td><mx:select id="secondarygroups" /></td> </tr> <tr> ! <td>Password : </td> ! <td><input type=text name="password" /></td> </tr> <tr> ! <td>Preferred language : </td> ! <td><mx:select id="preflang" /></td> ! </tr> ! <tr> ! <td><b>Delete User : </b></td> ! <td><input type="checkbox" value="1" name="delete"></td> ! </tr> ! ! <tr> ! <td colspan="2"><input type="submit" value="Apply Changes" /></td> ! </tr> </table> |
|
From: <jhe...@us...> - 2002-11-28 14:47:05
|
Update of /cvsroot/upcase-project/UpCase/templates/en In directory sc8-pr-cvs1:/tmp/cvs-serv21864 Modified Files: userslist.mxt Log Message: action attributes are set as modelixe tags Index: userslist.mxt =================================================================== RCS file: /cvsroot/upcase-project/UpCase/templates/en/userslist.mxt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** userslist.mxt 13 Nov 2002 08:41:31 -0000 1.2 --- userslist.mxt 28 Nov 2002 14:47:02 -0000 1.3 *************** *** 10,14 **** <center> <h3 align="center">Account Creation</h3> ! <form action="newuser.php"> <table> <tr> --- 10,14 ---- <center> <h3 align="center">Account Creation</h3> ! <form mXattribut="action:usercreate"> <table> <tr> *************** *** 24,35 **** <center> <h3 align="center">Account Edition</h3> ! <form action="useredit.php"> <table> <tr> <td>Select a user : <select name="username"> ! <mx:bloc id="users_list"> <option value="<mx:text id="user" />"><mx:text id="user" /></option> ! </mx:bloc id="users_list"> </select> </td> --- 24,35 ---- <center> <h3 align="center">Account Edition</h3> ! <form mXattribut="action:useredit"> <table> <tr> <td>Select a user : <select name="username"> ! <mx:bloc id="usersList"> <option value="<mx:text id="user" />"><mx:text id="user" /></option> ! </mx:bloc id="usersList"> </select> </td> *************** *** 45,49 **** <h3 align="center">Group Creation</h3> <center> ! <form action="newgroup.php"> <table> <tr> --- 45,49 ---- <h3 align="center">Group Creation</h3> <center> ! <form mXattribut="action:groupcreate"> <table> <tr> *************** *** 58,62 **** <h3 align="center">Group Deletion</h3> <center> ! <form action="groupdel.php"> <table> <tr> --- 58,62 ---- <h3 align="center">Group Deletion</h3> <center> ! <form mXattribut="action:groupdel"> <table> <tr> |
|
From: <jhe...@us...> - 2002-11-28 14:44:22
|
Update of /cvsroot/upcase-project/UpCase/admin/messages
In directory sc8-pr-cvs1:/tmp/cvs-serv20081
Modified Files:
badlogin.php
Log Message:
added back link
Index: badlogin.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/admin/messages/badlogin.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** badlogin.php 8 Aug 2002 13:49:00 -0000 1.2
--- badlogin.php 28 Nov 2002 14:44:19 -0000 1.3
***************
*** 8,11 ****
--- 8,12 ----
$tmpl = new ModeliXe($uc_tmpl["BAD_LOGIN"]);
$tmpl->SetModeliXe();
+ $tmpl->MxUrl("back", $ret);
$tmpl->MxWrite();
?>
|
|
From: <jhe...@us...> - 2002-11-28 14:43:57
|
Update of /cvsroot/upcase-project/UpCase/admin/messages
In directory sc8-pr-cvs1:/tmp/cvs-serv19812
Added Files:
adminsonly.php accessdenied.php
Log Message:
2 new adminstrative messages
--- NEW FILE: adminsonly.php ---
<?php
include_once("../../config/uc_config.inc");
include_once("uc_page.php");
include("uc_templates.php");
$tmpl = new ModeliXe($uc_tmpl["ADMINS_ONLY"]);
$tmpl->SetModeliXe();
$tmpl->MxWrite();
?>
--- NEW FILE: accessdenied.php ---
<?php
include_once("../../config/uc_config.inc");
include_once("uc_page.php");
$page = new UcPage();
include_once("uc_templates.php");
$tmpl = new ModeliXe($uc_tmpl["ACCESS_DENIED"]);
$tmpl->SetModeliXe();
$tmpl->MxWrite();
?>
|
|
From: <jhe...@us...> - 2002-11-28 14:42:42
|
Update of /cvsroot/upcase-project/UpCase/admin In directory sc8-pr-cvs1:/tmp/cvs-serv18675 Removed Files: userupdate.php Log Message: never used this file --- userupdate.php DELETED --- |
|
From: <jhe...@us...> - 2002-11-28 14:41:45
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv17795
Modified Files:
userslist.php
Log Message:
removed sql, uses the account manager
Index: userslist.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/admin/userslist.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** userslist.php 12 Nov 2002 18:17:23 -0000 1.1
--- userslist.php 28 Nov 2002 14:41:42 -0000 1.2
***************
*** 1,17 ****
<?php
-
- /*
- * No input variables
- *
- * Template tags :
- * user_list : bloc
- * user : user name
- * useredit : link to the page to edit the user
- */
-
include_once("../config/uc_config.inc");
! include_once("lib/uc_sql.php");
! include_once("lib/uc_page.php");
$page = new UcPage("usersList");
--- 1,7 ----
<?php
include_once("../config/uc_config.inc");
! include_once("uc_page.php");
! include_once("uc_accounts.php");
$page = new UcPage("usersList");
***************
*** 22,53 ****
$tmpl->SetModeliXe();
! $db = new UcSQL($ucConfig);
! $query = $ucsql_allusers;
! $res = $db->Execute($query) or die("Unable to fetch users list: "
! . $db->ErrorMsg());
! if ($res)
{
! while ($o = $res->FetchNextobject(true))
! {
! $tmpl->MxText("users_list.user", $o->USERNAME);
! $tmpl->MxUrl("users_list.useredit", "useredit.php",
! array("username" => $o->USERNAME));
! $tmpl->MxBloc("users_list", "loop");
! }
}
!
! $query = $ucsql_allgroups;
! $res = $db->Execute($query) or die("Unable to fetch groups list: "
! . $db->ErrorMsg());
! if ($res)
{
! while ($o = $res->FetchNextObject(true))
! {
! if ($o->GROUPNAME == "all" || $o->GROUPNAME == "admins")
! continue;
! $tmpl->MxText("groupList.group", $o->GROUPNAME);
! $tmpl->MxBloc("groupList", "loop");
! }
}
$tmpl->MxText("upcase", "UpCase");
--- 12,34 ----
$tmpl->SetModeliXe();
! $tmpl->MxAttribut("usercreate", "newuser.php");
! $tmpl->MxAttribut("useredit", "useredit.php");
! $tmpl->MxAttribut("groupcreate", "newgroup.php");
! $tmpl->MxAttribut("groupdel", "groupdel.php");
! $accountMgr = new UcAccountManager($page->session->db);
! $users = $accountMgr->listUsers();
! foreach ($users as $userName)
{
! $tmpl->MxText("usersList.user", $userName);
! $tmpl->MxBloc("usersList", "loop");
}
! $groups = $accountMgr->listGroups();
! foreach ($groups as $groupId => $groupName)
{
! if ($groupId == ALL_GID || $groupId == ADMINS_GID)
! continue;
! $tmpl->MxText("groupList.group", $groupName);
! $tmpl->MxBloc("groupList", "loop");
}
$tmpl->MxText("upcase", "UpCase");
|
|
From: <jhe...@us...> - 2002-11-28 14:40:07
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv16360
Modified Files:
useredit.php
Log Message:
added user deletion, use the account manager
Index: useredit.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/admin/useredit.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** useredit.php 12 Nov 2002 17:56:17 -0000 1.3
--- useredit.php 28 Nov 2002 14:40:04 -0000 1.4
***************
*** 10,54 ****
include_once("../config/uc_config.inc");
!
! include_once("lib/uc_page.php");
$page = new UcPage("userEdition");
$page->open();
!
session_register("user");
include("config/uc_templates.inc");
$tmpl = new ModeliXe($uc_tmpl["USER_EDIT"]);
$tmpl->SetModeliXe();
! if (isset($username))
{
! $user = getUser($username, '');
}
else
{
- $db = new UcSql();
- $user->db = $db;
$user->setPrimaryGroup($primarygroup);
$user->setLanguage($preflang);
if (isset($secondarygroups))
$user->setSecondaryGroups($secondarygroups);
else
$user->setSecondaryGroups(array());
if (strlen($password) > 0)
! $user->setPassword($password);
$user->setFirstName($firstname);
$user->setLastName($lastname);
$user->setEmail($email);
}
! $groups = getAllGroups();
!
$tmpl->MxText("username", $user->name);
$tmpl->MxSelect("primarygroup", "primarygroup",
$user->gid, $groups);
$tmpl->MxSelect("secondarygroups", "secondarygroups",
! $user->groups, $groups, "", 5);
$tmpl->MxSelect("preflang", "preflang",
$user->lang, $ucConfig->languages);
--- 10,64 ----
include_once("../config/uc_config.inc");
! include_once("uc_page.php");
! include_once("uc_utils.php");
! include_once("uc_accounts.php");
$page = new UcPage("userEdition");
$page->open();
! $username = checkVar("username", false);
!
session_register("user");
+
+ if (checkVar("delete", false))
+ header("Location: " . $ucConfig->upcaseUrl
+ . "/admin/userdel.php?uid=$user->uid");
+
include("config/uc_templates.inc");
$tmpl = new ModeliXe($uc_tmpl["USER_EDIT"]);
$tmpl->SetModeliXe();
! $accountMgr = new UcAccountManager($page->session->db);
!
! if ($username)
{
! $user = $accountMgr->getUser($username);
}
else
{
$user->setPrimaryGroup($primarygroup);
$user->setLanguage($preflang);
if (isset($secondarygroups))
+ {
$user->setSecondaryGroups($secondarygroups);
+ }
else
$user->setSecondaryGroups(array());
if (strlen($password) > 0)
! $accountMgr->setUserPassword($user, $password);
$user->setFirstName($firstname);
$user->setLastName($lastname);
$user->setEmail($email);
+ $accountMgr->updateUser($user);
}
! $groups = $accountMgr->listGroups();
!
$tmpl->MxText("username", $user->name);
$tmpl->MxSelect("primarygroup", "primarygroup",
$user->gid, $groups);
$tmpl->MxSelect("secondarygroups", "secondarygroups",
! $user->secGids, $groups, "", 5);
$tmpl->MxSelect("preflang", "preflang",
$user->lang, $ucConfig->languages);
|
|
From: <jhe...@us...> - 2002-11-28 14:39:11
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv15492
Modified Files:
userdel.php
Log Message:
implemented with account manager
Index: userdel.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/admin/userdel.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** userdel.php 12 Nov 2002 17:54:00 -0000 1.1
--- userdel.php 28 Nov 2002 14:39:08 -0000 1.2
***************
*** 1,14 ****
<?php
include_once("../config/uc_config.inc");
! include_once("lib/uc_page.inc");
$page = new UcPage("userDeletion");
$page->open();
! include("config/uc_templates.inc");
!
! $tmpl->setModeliXe();
!
!
! $tmpl->MxWrite();
?>
--- 1,17 ----
<?php
include_once("../config/uc_config.inc");
! include_once("uc_page.php");
! include_once("uc_utils.php");
$page = new UcPage("userDeletion");
$page->open();
! $userId = checkVar("uid", false)
! or die("No userid given");
!
! $accountMgr = new UcAccountManager($page->session->db);
! $user = $accountMgr->getUser('', $userId);
! $accountMgr->deleteUser($user);
! header("Location: " . $ucConfig->upcaseUrl
! . "/admin/userslist.php");
?>
|
|
From: <jhe...@us...> - 2002-11-28 14:38:22
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv14922
Modified Files:
newuser.php
Log Message:
now use the account manager
Index: newuser.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/admin/newuser.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** newuser.php 20 Nov 2002 14:30:20 -0000 1.2
--- newuser.php 28 Nov 2002 14:38:19 -0000 1.3
***************
*** 1,22 ****
<?php
-
include_once("../config/uc_config.inc");
!
! include_once("lib/uc_accounts.php");
!
! include_once("lib/uc_page.php");
$page = new UcPage("newUser");
$page->open();
!
! if (isset($newuser))
! {
! createUser($newuser);
! header("Location: " . $ucConfig->upcaseUrl
! . "/admin/useredit.php?username=$newuser&sessid=$sessid");
! }
!
! include("config/uc_templates.inc");
! $tmpl = new ModeliXe($uc_tmpl["NEW_USER"]);
! $tmpl->SetModeliXe();
! $tmpl->MxWrite();
?>
--- 1,15 ----
<?php
include_once("../config/uc_config.inc");
! include_once("uc_accounts.php");
! include_once("uc_page.php");
! include_once("uc_utils.php");
$page = new UcPage("newUser");
$page->open();
! $username = checkVar("newuser", false)
! or die("No user name given");
! $accountMgr = new UcAccountManager($page->session->db);
! $user = $accountMgr->createUser($username);
! $user = $accountMgr->addUser($user);
! header("Location: " . $ucConfig->upcaseUrl
! . "/admin/useredit.php?username=$user->name&sessid=$sessid");
?>
|
|
From: <jhe...@us...> - 2002-11-28 14:37:35
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv14212
Modified Files:
newgroup.php
Log Message:
removed all sql. Now use the account manager
Index: newgroup.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/admin/newgroup.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** newgroup.php 12 Nov 2002 17:48:50 -0000 1.1
--- newgroup.php 28 Nov 2002 14:37:32 -0000 1.2
***************
*** 2,26 ****
include_once("../config/uc_config.inc");
! include_once("lib/uc_page.php");
! include_once("lib/uc_sql.php");
$page = new UcPage("groupCreation");
$page->open();
!
! include("config/uc_templates.inc");
! $tmpl = new ModeliXe($uc_tmpl["NEW_GROUP"]);
! $tmpl->SetModeliXe();
!
! if (!empty($newgroup))
! {
! $query = sprintf($ucsql_groupadd, $newgroup);
! print($query);
! $db = new UcSql();
! $db->Execute($query) or die("Unable to create group: " .
! $db->ErrorMsg());
! }
!
! $tmpl->MxText("groupname", $newgroup);
! $tmpl->MxWrite();
?>
--- 2,17 ----
include_once("../config/uc_config.inc");
! include_once("uc_page.php");
! include_once("uc_accounts.php");
! include_once("uc_utils.php");
$page = new UcPage("groupCreation");
$page->open();
! $groupName = checkVar("newgroup", false)
! or die("No group name given");
! $accountMgr = new UcAccountManager($page->session->db);
! $group = $accountMgr->createGroup($groupName);
! $accountMgr->addGroup($group);
! header("Location: " . $ucConfig->upcaseUrl . "/admin/userslist.php");
?>
|
|
From: <jhe...@us...> - 2002-11-28 14:36:45
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv13632
Modified Files:
groupdel.php
Log Message:
removed every sql. Now use the account manager
Index: groupdel.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/admin/groupdel.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** groupdel.php 12 Nov 2002 17:44:00 -0000 1.1
--- groupdel.php 28 Nov 2002 14:36:43 -0000 1.2
***************
*** 1,5 ****
<?php
include_once("../config/uc_config.inc");
! include_once("lib/uc_page.php");
include_once("lib/uc_sql.php");
--- 1,8 ----
<?php
include_once("../config/uc_config.inc");
! include_once("uc_page.php");
! include_once("uc_accounts.php");
! include_once("uc_utils.php");
!
include_once("lib/uc_sql.php");
***************
*** 7,47 ****
$page->open();
! include("config/uc_templates.inc");
!
! if (!empty($groupname))
! {
! $db = new UcSql();
!
! // First check if this is a primary group
! $query = sprintf($ucsql_primarygroup, $groupname);
! $res = $db->Execute($query) or die("Unable to check primary group: "
! . $db->ErrorMsg());
! if ($res->RowCount() != 0)
! {
! $tmpl = new ModeliXe($uc_tmpl["GROUP_WARNING"]);
! }
! else
! {
! // and remove every references in memberships table
! $query = sprintf($ucsql_groupget, $groupname);
! $res = $db->Execute($query) or die("Unable to get group id: "
! . $db->ErrorMsg());
! if ($res->RowCount() == 0)
! die("No such group");
! $o = $res->FetchNextObject(true);
! $query = sprintf($ucsql_memgrpdel, $o->GID);
! $db->Execute($query) or die("Unable to remove group from memberships: "
! . $db->ErrorMsg());
! // delete this group
! $query = sprintf($ucsql_groupdel, $groupname);
! $db->Execute($query) or die("Unable to delete group: "
! . $db->ErrorMsg());
!
! $tmpl = new ModeliXe($uc_tmpl["GROUP_DELETE"]);
! }
! }
! $tmpl->SetModeliXe();
! $tmpl->MxText("groupname", $groupname);
! $tmpl->MxWrite();
?>
--- 10,20 ----
$page->open();
! $groupName = checkVar("groupname", false)
! or die("No group name given");
! $accountMgr = new UcAccountManager($page->session->db);
! $group = $accountMgr->getGroup($groupName);
! if (!$accountMgr->deleteGroup($group))
! die("Can't delete a primary group");
! header("Location: " . $ucConfig->upcaseUrl . "/admin/userslist.php");
?>
|
|
From: <jhe...@us...> - 2002-11-28 14:36:26
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv12873
Modified Files:
category.php
Log Message:
fixed some bugs in modelixe loops
Index: category.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/admin/category.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** category.php 21 Nov 2002 15:18:35 -0000 1.5
--- category.php 28 Nov 2002 14:35:57 -0000 1.6
***************
*** 1,42 ****
<?php
include_once("../config/uc_config.inc");
- // ModeliXe tags:
- //
- // list_from : url of the package.xml file where info comes from
- // pkg_list : looped block that list packages info
- // pkg_name : name of a package
- // pkg_version : package version
- // pkg_descr : package description, translated
- // pkg_status : package status
- // pkg_home : home page of the original package
- // pkg_instlink : url of the script that will install the package
// First lines to include
! include_once("lib/uc_page.php");
// Start the session
$p = new UcPage("category");
-
- // Check permissions, log in if necessary
$p->open();
$sess = $p->getSession();
$user = $sess->getUser();
- // other includes
- //include_once("lib/uc_packages.php");
- include_once("lib/uc_repository.php");
- include_once("lib/uc_installer.php");
! if (!empty($_GET["catname"]))
! $catname = $_GET["catname"];
! else if (!empty($_POST["catname"]))
! $catname = $_POST["catname"];
! else
! die("No category selected");
- // don't use the include_once directive unless you want
- // to always display this page in the default language
include("config/uc_templates.inc");
-
- // prepare template
$tmpl = new ModeliXe($uc_tmpl["CATEGORY"]);
$tmpl->SetModeliXe();
--- 1,21 ----
<?php
include_once("../config/uc_config.inc");
// First lines to include
! include_once("uc_page.php");
// Start the session
$p = new UcPage("category");
$p->open();
$sess = $p->getSession();
$user = $sess->getUser();
+ include_once("uc_repository.php");
+ include_once("uc_installer.php");
+ include_once("uc_utils.php");
! $catname = checkVar("catname", false)
! or die("No category selected");
include("config/uc_templates.inc");
$tmpl = new ModeliXe($uc_tmpl["CATEGORY"]);
$tmpl->SetModeliXe();
***************
*** 65,95 ****
$tmpl->MxUrl("packages.installer",
$ucConfig->upcaseUrl . "/admin/installer.php",
! array("cat" => $catname, "pkg" => $package->name));
! if ($package->supported == 0)
! $tmpl->MxBloc("packages.support", "modify",
! $ucConfig->upcaseRoot . "/templates/en/unsupported.mxt");
! else
$tmpl->MxBloc("packages.support", "delete");
$instances = $inst->getPackages($package->name);
! foreach ($instances as $instance)
{
! $tmpl->MxText("packages.instances.pkgver", $instance->version);
! $tmpl->MxText("packages.instances.pkgurl",
$ucConfig->siteUrl . "/" . $instance->path);
! $tmpl->MxAttribut("packages.instances.pkgurl",
! $ucConfig->siteUrl . "/" . $instance->path);
! $tmpl->MxText("packages.instances.pkgstatus", $instance->status);
! $tmpl->MxUrl("packages.instances.uninstall",
! $ucConfig->upcaseUrl . "/admin/installer.php",
! array("pkg" => $instance->name,
! "ver" => $instance->version,
! "url" => $instance->path,
! "cat" => $catname,
! "uninstall" => "do"));
! $tmpl->MxBloc("packages.instances", "loop");
}
-
$tmpl->MxBloc("packages", "loop");
}
--- 44,79 ----
$tmpl->MxUrl("packages.installer",
$ucConfig->upcaseUrl . "/admin/installer.php",
! array("cat" => $catname,
! "pkg" => $package->name,
! "op" => "preinstall"));
! if ($package->supported == 1)
$tmpl->MxBloc("packages.support", "delete");
$instances = $inst->getPackages($package->name);
! if (count($instances) > 0)
{
! foreach ($instances as $instance)
! {
! $tmpl->MxText("packages.instances.pkgver", $instance->version);
! $tmpl->MxText("packages.instances.pkgurl",
! $ucConfig->siteUrl . "/" . $instance->path);
! $tmpl->MxAttribut("packages.instances.pkgurl",
$ucConfig->siteUrl . "/" . $instance->path);
! $tmpl->MxText("packages.instances.pkgstatus", $instance->status);
! $tmpl->MxUrl("packages.instances.uninstall",
! $ucConfig->upcaseUrl . "/admin/installer.php",
! array("pkg" => $instance->name,
! "ver" => $instance->version,
! "url" => $instance->path,
! "cat" => $catname,
! "op" => "uninstall"));
! $tmpl->MxBloc("packages.instances", "loop");
! }
! }
! else
! {
! $tmpl->MxBloc("packages.instances", "delete");
}
$tmpl->MxBloc("packages", "loop");
}
|
|
From: <jhe...@us...> - 2002-11-28 14:34:47
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv11486
Modified Files:
installer.php
Log Message:
splitted installation in pre, configure and install setps, with configure
allowing user to input data if the package request it.
Index: installer.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/admin/installer.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** installer.php 21 Nov 2002 15:20:14 -0000 1.8
--- installer.php 28 Nov 2002 14:34:44 -0000 1.9
***************
*** 33,84 ****
die("Invalid package2");
! if (checkVar("install", false))
! $operation = "install";
! else if (checkVar("upgrade", false))
! {
! $operation = "upgrade";
! die("Not yet implemented");
! }
! else if (checkVar("cancel", false))
! {
! $operation = "cancel";
! die("Not yet implemented");
! }
! else if (checkVar("uninstall", false))
! {
! $operation = "uninstall";
! }
! else
! $operation = "view";
// don't use the include_once directive unless you want
// to always display this page in the default language
include("config/uc_templates.inc");
!
! if ($operation == "view")
{
! $tmpl = new ModeliXe($uc_tmpl["INSTALLER"]);
$tmpl->SetModeliXe();
! $tmpl->MxAttribut("installer", $ucConfig->upcaseUrl . "/admin/installer.php");
$tmpl->MxText("pkgname", $package->name);
- $tmpl->MxText("siteroot", $ucConfig->siteUrl . "/");
- $tmpl->MxText("catname", $category->name);
$tmpl->MxWrite();
}
! else if ($operation == "install")
{
! $cfg = $GLOBALS["ucConfig"];
! if (checkVar("pkgurl", false))
! $pkgRelUrl = checkVar("pkgurl");
! else
! die("Please give a url that is under your site root");
! if (checkVar("tblprefix", false))
! $tblPrefix = checkVar("tblprefix");
else
! die("You MUST specify a tables prefix");
! $inst->saveMetaData($package);
! $redirect = $inst->install($package, $pkgRelUrl, $tblPrefix);
header("Location: " . $redirect);
}
else if ($operation == "uninstall")
{
--- 33,153 ----
die("Invalid package2");
! $operation = "configure";
! if (checkVar("op", false))
! $operation = checkVar("op");
!
// don't use the include_once directive unless you want
// to always display this page in the default language
include("config/uc_templates.inc");
! if ($operation == "preinstall")
{
! $tmpl = new ModeliXe($uc_tmpl["PREINSTALL"]);
$tmpl->SetModeliXe();
!
! $tmpl->MxAttribut("installer",
! $ucConfig->upcaseUrl . "/admin/installer.php");
! $tmpl->MxHidden("params", "op=configure&cat=$catname&pkg=$pkgname");
! $tmpl->MxText("siteurl", $ucConfig->siteUrl);
$tmpl->MxText("pkgname", $package->name);
$tmpl->MxWrite();
}
!
! else if ($operation == "configure")
{
! $pkgPath = checkVar("pkgpath", false)
! or die("No destination path defined");
! $tblPrefix = checkVar("tblprefix", false)
! or die("No tables prefix defined");
! $inst->preinstall($package, $pkgPath, $tblPrefix);
!
! if ($package->supported == 0)
! {
! header("Location: " . $ucConfig->upcaseUrl . "/admin/installer.php"
! . "?op=install&cat=$catname&pkg=$pkgname"
! . "&tblprefix=$tblPrefix&pkgpath=$pkgPath");
! exit();
! }
!
! $inputs = $inst->getConfigInputs($package, $pkgPath);
!
! if ($inputs)
! {
! $tmpl = new ModeliXe($uc_tmpl["CONFIGURE"]);
! $tmpl->SetModeliXe();
! $tmpl->MxAttribut("installer",
! $ucConfig->upcaseUrl . "/admin/installer.php");
! $tmpl->MxHidden("params",
! "op=install&pkgpath=$pkgPath&cat=$catname&pkg=$pkgname&tblprefix=$tblPrefix");
! $tmpl->MxText("pkgname", $package->name);
! $tmpl->MxFormField("pkgprefix", "text", "tblprefix", $package->name);
! foreach ($inputs as $inputVar => $inputInfo)
! {
! $tmpl->MxText("inputs.label", $inputInfo[2]);
! if ($inputInfo[0] == "text")
! {
! $tmpl->MxBloc("inputs.enums", "delete");
! $tmpl->MxBloc("inputs.booleans", "delete");
! $tmpl->MxFormField("inputs.fields.field", "text",
! $inputVar, $inputInfo[1]);
! }
! else if ($inputInfo[0] == "password")
! {
! $tmpl->MxBloc("inputs.enums", "delete");
! $tmpl->MxBloc("inputs.booleans", "delete");
! $tmpl->MxFormField("inputs.fields.field", "password",
! $inputVar, "");
! }
! else if ($inputInfo[0] == "boolean")
! {
! $tmpl->MxBloc("inputs.fields", "delete");
! $tmpl->MxBloc("inputs.enums", "delete");
! $tmpl->MxCheckerField("inputs.booleans.boolean", "checkbox",
! $inputVar, $inputInfo[1]);
! }
! else if ($inputInfo[0] == "enum")
! {
! $tmpl->MxBloc("inputs.fields", "delete");
! $tmpl->MxBloc("inputs.booleans", "delete");
! $tmpl->MxSelect("inputs.enums.enum", $inputVar, $inputInfo[1],
! $inputInfo[3]);
! }
! $tmpl->MxBloc("inputs", "loop");
! }
! $tmpl->MxWrite();
! }
else
! {
! header("Location: " . $ucConfig->upcaseUrl . "/admin/installer.php"
! . "?op=install&cat=$catname&pkg=$pkgname"
! . "&tblprefix=$tblPrefix&pkgpath=$pkgPath");
! }
! }
!
! else if ($operation == "install")
! {
! $configData = array();
! $configData["TABLES_PREFIX"] = checkVar("tblprefix", false)
! or die("No tables prefix defined");
! $configData["PACKAGE_PATH"] = checkVar("pkgpath", false)
! or die("No package path defined");
!
! if ($package->supported == 1)
! {
! $configInputs = $inst->getConfigInputs($package,
! $configData["PACKAGE_PATH"]);
! if ($configInputs)
! {
! foreach (array_keys($configInputs) as $key)
! {
! if (checkVar($key, false))
! $configData[$key] = checkVar($key);
! }
! }
! }
! $redirect = $inst->install($package, $configData);
header("Location: " . $redirect);
}
+
else if ($operation == "uninstall")
{
***************
*** 87,94 ****
--- 156,167 ----
. "/admin/category.php?catname=" . $catname);
}
+
else if ($operation == "upgrade")
{
die("Not yet implemented upgrade feature");
}
+
+ else
+ die("Invalid installer operation");
?>
|
|
From: <jhe...@us...> - 2002-11-28 14:32:42
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv10371
Modified Files:
uc_templates.php
Log Message:
include path
Index: uc_templates.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/lib/uc_templates.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** uc_templates.php 16 Jul 2002 15:31:56 -0000 1.1.1.1
--- uc_templates.php 28 Nov 2002 14:32:36 -0000 1.2
***************
*** 4,8 ****
! include_once("lib/ModeliXe.php");
// Delete all blocs marked with a group name as id
--- 4,8 ----
! include_once("ModeliXe.php");
// Delete all blocs marked with a group name as id
|
|
From: <jhe...@us...> - 2002-11-28 14:31:38
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv9459
Modified Files:
uc_object.php
Log Message:
little refactoring, disabled reading of description (unused)
Index: uc_object.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/lib/uc_object.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** uc_object.php 5 Aug 2002 08:29:02 -0000 1.2
--- uc_object.php 28 Nov 2002 14:31:35 -0000 1.3
***************
*** 18,22 ****
{
global $ucsql_objget;
- global $ucsql_objadd;
global $uc_translations;
--- 18,21 ----
***************
*** 30,47 ****
. $this->db->ErrorMsg());
if ($res->RowCount() == 0)
! {
! // Create the object accessible only by admins
! // This is the first record with NULL as gid
! $query = sprintf($ucsql_objadd, $this->oid);
! $this->db->Execute($query) or die("Unable to create object: "
! . $this->db->ErrorMsg());
! $this->newObject = true;
! }
// read the object description
! $this->description = new UcObjectDescription($oid);
! $this->description->parse($uc_translations["object_descriptions"]);
}
!
function getDescription($lang)
{
--- 29,47 ----
. $this->db->ErrorMsg());
if ($res->RowCount() == 0)
! $this->register();
// read the object description
! //$this->description = new UcObjectDescription($oid);
! //$this->description->parse($uc_translations["object_descriptions"]);
}
!
! function register()
! {
! $query = sprintf($GLOBALS["ucsql_objadd"], $this->oid);
! $this->db->Execute($query)
! or die("Unable to create object: " . $this->db->ErrorMsg());
! $this->newObject = true;
! }
!
function getDescription($lang)
{
|
|
From: <jhe...@us...> - 2002-11-28 14:29:10
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv7754
Modified Files:
uc_session.php
Log Message:
refactoring, adapted to use account manager
Index: uc_session.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/lib/uc_session.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** uc_session.php 22 Nov 2002 13:45:36 -0000 1.5
--- uc_session.php 28 Nov 2002 14:28:49 -0000 1.6
***************
*** 13,23 ****
var $db;
var $returnPath;
function UcSession($uri)
{
- global $ucsql_sessioncreate;
- global $ucsql_sessionget;
global $ucsid;
$this->name = "ucsid";
--- 13,26 ----
var $db;
var $returnPath;
+
+ var $accountMgr;
function UcSession($uri)
{
global $ucsid;
+ $this->db = new UcSql();
+ $this->accountMgr = new UcAccountManager($this->db);
+
$this->name = "ucsid";
***************
*** 27,37 ****
$this->sessid = $ucsid;
-
- $this->db = new UcSql();
$ar = parse_url($uri);
$this->returnPath = $ar["path"];
! $query = sprintf($ucsql_sessionget, $this->sessid);
$res = $this->db->Execute($query) or die("Unable to check session: "
. $this->db->ErrorMsg());
--- 30,38 ----
$this->sessid = $ucsid;
$ar = parse_url($uri);
$this->returnPath = $ar["path"];
! $query = sprintf($GLOBALS["ucsql_sessionget"], $this->sessid);
$res = $this->db->Execute($query) or die("Unable to check session: "
. $this->db->ErrorMsg());
***************
*** 39,43 ****
{
// Create a record for this session in the db
! $query = sprintf($ucsql_sessioncreate, $this->sessid);
$this->db->Execute($query)
or die("Unable to add session to database: "
--- 40,44 ----
{
// Create a record for this session in the db
! $query = sprintf($GLOBALS["ucsql_sessioncreate"], $this->sessid);
$this->db->Execute($query)
or die("Unable to add session to database: "
***************
*** 51,57 ****
function destroy()
{
! global $ucsql_sessiondestroy;
!
! $query = sprintf($ucsql_sessiondestroy, $this->sessid);
$this->db->Execute($query) or die("Unable to destroy session: "
. $this->db->ErrorMsg());
--- 52,56 ----
function destroy()
{
! $query = sprintf($GLOBALS["ucsql_sessiondestroy"], $this->sessid);
$this->db->Execute($query) or die("Unable to destroy session: "
. $this->db->ErrorMsg());
***************
*** 60,99 ****
function checkIp()
{
- global $ucsql_sessionget;
- global $ucsql_sessionsetip;
global $uc_info;
if (getenv("HTTP_X_FORWARDED_FOR"))
- {
$ip = getenv("HTTP_X_FORWARDED_FOR");
- }
else
- {
$ip = getenv("REMOTE_ADDR");
- }
! $query = sprintf($ucsql_sessionget, $this->sessid);
$res = $this->db->Execute($query) or die("Unable to get session: "
. $this->db->ErrorMsg());
$o = $res->FetchNextObject();
-
// Check validity of IP address
! if ($o->IP)
{
if ($o->IP != $ip)
- {
- // session accessed from another IP, display message
header("Location: " . $uc_info["sessionSteal"]);
! }
! // ok, good IP
! return true;
}
-
- // No IP set in the session, do it now
- $query = sprintf($ucsql_sessionsetip, $ip, $this->sessid);
- $res = $this->db->Execute($query) or
- die("Unable to set IP for the session: " . $this->db->ErrorMsg());
-
- return true;
}
--- 59,91 ----
function checkIp()
{
global $uc_info;
if (getenv("HTTP_X_FORWARDED_FOR"))
$ip = getenv("HTTP_X_FORWARDED_FOR");
else
$ip = getenv("REMOTE_ADDR");
! $query = sprintf($GLOBALS["ucsql_sessionget"], $this->sessid);
$res = $this->db->Execute($query) or die("Unable to get session: "
. $this->db->ErrorMsg());
$o = $res->FetchNextObject();
// Check validity of IP address
! if (empty($o->IP))
! {
! // No IP set in the session, do it now
! $query = sprintf($GLOBALS["ucsql_sessionsetip"],
! $ip, $this->sessid);
! $res = $this->db->Execute($query) or
! die("Unable to set IP for the session: "
! . $this->db->ErrorMsg());
! return true;
! }
! else
{
if ($o->IP != $ip)
header("Location: " . $uc_info["sessionSteal"]);
! else
! return true;
}
}
***************
*** 101,108 ****
function login($username, $password)
{
- global $username;
- global $password;
global $uc_info;
- global $ucsql_sessionlogin;
// we have the password/login
--- 93,97 ----
***************
*** 110,115 ****
{
// good, update session with user
! $this->user = getUser($username, '');
! $query = sprintf($ucsql_sessionlogin,
$this->user->uid,
$this->sessid);
--- 99,104 ----
{
// good, update session with user
! $this->user = $this->accountMgr->getUser($username, '');
! $query = sprintf($GLOBALS["ucsql_sessionlogin"],
$this->user->uid,
$this->sessid);
***************
*** 128,133 ****
function logout()
{
! global $ucsql_sessionlogout;
! $query = sprintf($ucsql_sessionlogout, $this->sessid);
$this->db->Execute($query)
or die("UPCASE: Unable to logout the session: "
--- 117,121 ----
function logout()
{
! $query = sprintf($GLOBALS["ucsql_sessionlogout"], $this->sessid);
$this->db->Execute($query)
or die("UPCASE: Unable to logout the session: "
***************
*** 139,143 ****
setcookie($this->name, "", time() - 3600, $ar["path"],
$ar["domain"], $ar["secure"]);
-
$this->destroy();
}
--- 127,130 ----
***************
*** 155,172 ****
$o = $res->FetchNextObject();
if (!empty($o->UID))
! {
! $user = getUser('', $o->UID);
! return $user;
! }
}
-
- $anonuser = new UcUser();
- $anonuser->name = "anonymous";
- $anonuser->uid = -1;
- $anonuser->gid = -1;
- $anonuser->lang = $ucConfig->defaultLang;
- $anonuser->groups = array();
- $user = $anonuser;
-
return $user;
}
--- 142,153 ----
$o = $res->FetchNextObject();
if (!empty($o->UID))
! $user = $this->accountMgr->getUser('', $o->UID);
! else
! $user = $this->accountMgr->anonymousUser();
! }
! else
! {
! $user = $this->accountMgr->anonymousUser();
}
return $user;
}
***************
*** 174,186 ****
function checkPassword($username, $password)
{
! global $ucsql_usercheckpw;
! $query = sprintf($ucsql_usercheckpw, $username, $password);
! $res = $this->db->Execute($query) or
! die("UPCASE: Error while checking password: " . $this->db->ErrorMsg());
! if ($res->RowCount() != 1)
! {
! return false;
! }
! return true;
}
--- 155,159 ----
function checkPassword($username, $password)
{
! return $this->accountMgr->checkUserPassword($username, $password);
}
|
|
From: <jhe...@us...> - 2002-11-28 14:27:27
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv6468
Modified Files:
uc_installer.php
Log Message:
big refactoring, added the possibility for a package to ask users input
during installation.
Index: uc_installer.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/lib/uc_installer.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** uc_installer.php 21 Nov 2002 15:16:13 -0000 1.7
--- uc_installer.php 28 Nov 2002 14:27:22 -0000 1.8
***************
*** 26,30 ****
var $metaDataFile;
! function UcPackageInstance($name, $version, $path, $tblPrefix)
{
$cfg = $GLOBALS["ucConfig"];
--- 26,30 ----
var $metaDataFile;
! function UcPackageInstance($name, $version, $configData)
{
$cfg = $GLOBALS["ucConfig"];
***************
*** 38,44 ****
$this->source = $source;
$this->supported = $supported;
! $this->path = $path;
! $this->prefix = $tblPrefix;
$this->tables = $tables;
}
--- 38,45 ----
$this->source = $source;
$this->supported = $supported;
! $this->path = $configData["PACKAGE_PATH"];
$this->tables = $tables;
+ $this->prefix = $configData["TABLES_PREFIX"];
+ $this->configData = $configData;
}
***************
*** 76,80 ****
{
$pkg = new UcPackageInstance($o->PKGNAME, $o->PKGVERSION,
! $o->PKGPATH, $o->TBLPREFIX);
$pkg->setStatus($o->INSTALLED);
$ret[] = $pkg;
--- 77,82 ----
{
$pkg = new UcPackageInstance($o->PKGNAME, $o->PKGVERSION,
! array("PACKAGE_PATH" => $o->PKGPATH,
! "TABLES_PREFIX" => $o->TBLPREFIX));
$pkg->setStatus($o->INSTALLED);
$ret[] = $pkg;
***************
*** 89,94 ****
$dstFile = $this->metaBackup . "/" . $package->name
. "-" . $package->version . ".inc";
! if (!file_exists($dstFile))
! copy($srcFile, $dstFile);
}
--- 91,95 ----
$dstFile = $this->metaBackup . "/" . $package->name
. "-" . $package->version . ".inc";
! copy($srcFile, $dstFile);
}
***************
*** 141,151 ****
}
! function setupMySQL($package, $sqlPath, $tblPrefix)
{
! if (!file_exists($sqlPath . MYSQL_QUERIES))
return false;
! $tblprefix = $tblPrefix . "_";
! include($sqlPath . MYSQL_QUERIES);
foreach($queries as $query)
{
--- 142,156 ----
}
! function setupMySQL($packageInstance)
{
! $cfg = $GLOBALS["ucConfig"];
! $sqlPath = $cfg->siteRoot . "/" . $packageInstance->path . "/"
! . MYSQL_QUERIES;
!
! if (!file_exists($sqlPath))
return false;
! $tblprefix = $packageInstance->prefix . "_";
! include($sqlPath);
foreach($queries as $query)
{
***************
*** 157,161 ****
}
! function setupPackage($package, $relPath, $tblPrefix)
{
$cfg = $GLOBALS["ucConfig"];
--- 162,178 ----
}
! function getConfigInputs($package, $pkgPath)
! {
! $cfg = $GLOBALS["ucConfig"];
!
! include_once($cfg->siteRoot . "/"
! . $pkgPath . PACKAGE_SETUP);
! if (!empty($config_input) || count($config_input) > 0)
! return $config_input;
! else
! return false;
! }
!
! function setupPackage($packageInstance)
{
$cfg = $GLOBALS["ucConfig"];
***************
*** 166,183 ****
$dbinf->passwd = $cfg->dbPasswd;
$dbinf->host = $cfg->dbHost;
! $dbinf->prefix = $tblPrefix . "_";
! include_once($cfg->siteRoot . "/" . $relPath . PACKAGE_SETUP);
! setup($dbinf, $cfg->siteUrl . "/" . $relPath,
! $cfg->siteRoot . "/" .$relPath)
or die("Unable to setup package");
return true;
}
! function registerPackage($package, $relPath, $tblPrefix)
{
$query = sprintf($GLOBALS["ucsql_packageregister"],
$package->name, $package->version,
! $relPath, $tblPrefix);
$this->db->Execute($query)
or die("Unable to register package: " . $this->db->ErrorMsg());
--- 183,200 ----
$dbinf->passwd = $cfg->dbPasswd;
$dbinf->host = $cfg->dbHost;
! $dbinf->prefix = $packageInstance->prefix . "_";
! include_once($cfg->siteRoot . "/"
! . $packageInstance->path . "/" . PACKAGE_SETUP);
! setup($dbinf, $cfg->siteUrl, $cfg->siteRoot, $packageInstance)
or die("Unable to setup package");
return true;
}
! function registerPackage($package, $destPath, $tblPrefix)
{
$query = sprintf($GLOBALS["ucsql_packageregister"],
$package->name, $package->version,
! $destPath, $tblPrefix);
$this->db->Execute($query)
or die("Unable to register package: " . $this->db->ErrorMsg());
***************
*** 198,241 ****
}
! function setInstallComplete($package, $relPath, $tblPrefix)
{
$query = sprintf($GLOBALS["ucsql_packageinstcomp"],
! $package->name, $package->version,
! $relPath, $tblPrefix);
$this->db->Execute($query)
or die("Unable to flag package as installed: " .
$this->db->ErrorMsg());
}
!
! function install($package, $relPath, $tblPrefix)
{
$cfg = $GLOBALS["ucConfig"];
! $pkgPath = $cfg->siteRoot . "/" . $relPath;
!
$this->download($package)
or die("Unable to get package archive");
! $this->checkPathValidity($pkgPath)
! or die("Invalid URL");
! $this->registerPackage($package, $relPath, $tblPrefix)
! or die("Unable to register package to be installed");
! createDirectory($pkgPath)
or die("Unable to create directory $pkgPath");
! $this->unpack($package, $pkgPath)
or die("Unable to unpack package");
if ($package->supported == 1)
{
! $this->setupMySQL($package, $pkgPath, $tblPrefix)
or die("Unable to set up MySQL");
! $this->setupPackage($package, $relPath, $tblPrefix)
or die("Unable to set up package");
! $redirect = $cfg->siteUrl . "/" . $relPath;
}
else
{
! $redirect = $cfg->siteUrl . "/" . $relPath
! . "/" . $package->setupScript
! . "?prefix=" . $tblPrefix;
}
! $this->setInstallComplete($package, $relPath, $tblPrefix);
return $redirect;
}
--- 215,265 ----
}
! function setInstallComplete($packageInstance)
{
$query = sprintf($GLOBALS["ucsql_packageinstcomp"],
! $packageInstance->name, $packageInstance->version,
! $packageInstance->path, $packageInstance->prefix);
$this->db->Execute($query)
or die("Unable to flag package as installed: " .
$this->db->ErrorMsg());
}
!
! function preInstall($package, $destPath, $tblPrefix)
{
$cfg = $GLOBALS["ucConfig"];
! $this->saveMetaData($package);
$this->download($package)
or die("Unable to get package archive");
! $fullPath = $cfg->siteRoot . "/" .$destPath;
! $this->checkPathValidity($fullPath)
! or die("Invalid destination path");
! $this->registerPackage($package, $destPath, $tblPrefix)
! or die("Unable to register package to be installed");
! createDirectory($fullPath)
or die("Unable to create directory $pkgPath");
! $this->unpack($package, $fullPath)
or die("Unable to unpack package");
+ }
+
+ function install($package, $configData)
+ {
+ $cfg = $GLOBALS["ucConfig"];
+ $packageInstance = new UcPackageInstance($package->name,
+ $package->version,
+ $configData);
if ($package->supported == 1)
{
! $this->setupMySQL($packageInstance)
or die("Unable to set up MySQL");
! $this->setupPackage($packageInstance)
or die("Unable to set up package");
! $redirect = $cfg->siteUrl . "/" . $packageInstance->path;
}
else
{
! $redirect = $cfg->siteUrl . "/" . $packageInstance->path
! . "/" . $package->setupScript;
}
! $this->setInstallComplete($packageInstance);
return $redirect;
}
|
|
From: <jhe...@us...> - 2002-11-28 14:25:34
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv5470
Modified Files:
uc_page.php
Log Message:
some refactoring plus use of defines to set admins and all gid
Index: uc_page.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/lib/uc_page.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** uc_page.php 22 Nov 2002 13:34:20 -0000 1.4
--- uc_page.php 28 Nov 2002 14:25:31 -0000 1.5
***************
*** 1,11 ****
<?php
! include_once("uc_config.inc");
! include_once("lib/uc_sql.php");
! include_once("lib/uc_object.php");
! include_once("lib/uc_session.php");
class UcPage
{
! var $path;
var $oid;
var $object;
--- 1,10 ----
<?php
! include_once("uc_sql.php");
! include_once("uc_object.php");
! include_once("uc_session.php");
class UcPage
{
! var $uri;
var $oid;
var $object;
***************
*** 15,19 ****
function UcPage($pageId = false)
{
- global $REQUEST_URI;
global $uc_info;
global $ucConfig;
--- 14,17 ----
***************
*** 22,33 ****
// keep the path to the page that we open
! $ar = parse_url($REQUEST_URI);
! $this->path = $ar["path"];
! $this->uri = $REQUEST_URI;
- // Open the session
- $this->session = new UcSession($this->uri);
- $this->session->lang = $ucConfig->defaultlang;
-
if (!$pageId)
{
--- 20,27 ----
// keep the path to the page that we open
! $this->uri = $GLOBALS["REQUEST_URI"];
!
! $this->startSession();
if (!$pageId)
{
***************
*** 47,56 ****
}
// This function return true if access is granted.
// It never returns if access is not granted
function open($forceLogin = false)
{
- // global $username;
- // global $password;
global $uc_info;
global $uc_lang;
--- 41,55 ----
}
+ function startSession()
+ {
+ $cfg = $GLOBALS["ucConfig"];
+ $this->session = new UcSession($this->uri);
+ $this->session->lang = $cfg->defaultLang;
+ }
+
// This function return true if access is granted.
// It never returns if access is not granted
function open($forceLogin = false)
{
global $uc_info;
global $uc_lang;
***************
*** 63,71 ****
// get permissions
$this->perms = $this->object->getPermissions();
// group _all_ don't need to go further, let the page display
// (if it is not visible only by admins of course)
! if (in_array(1, $this->perms)
! && !in_array(0, $this->perms)
&& !$forceLogin)
{
--- 62,71 ----
// get permissions
$this->perms = $this->object->getPermissions();
+ //print_r($this->perms);
// group _all_ don't need to go further, let the page display
// (if it is not visible only by admins of course)
! if (in_array(ALL_GID, $this->perms)
! && !in_array(ADMINS_GID, $this->perms)
&& !$forceLogin)
{
***************
*** 77,84 ****
$user = $this->session->getUser();
// get user's secondary groups gid
! $userGroups = $user->groups;
// add the user's primary group gid
$userGroups[] = $user->gid;
// set the lang for this user
--- 77,85 ----
$user = $this->session->getUser();
// get user's secondary groups gid
! $userGroups = $user->secGids;
// add the user's primary group gid
$userGroups[] = $user->gid;
+ //print_r($userGroups);
// set the lang for this user
***************
*** 86,90 ****
// is it an admin ?
! if (in_array(0, $userGroups))
{
// yes, acccess granted
--- 87,91 ----
// is it an admin ?
! if (in_array(ADMINS_GID, $userGroups))
{
// yes, acccess granted
***************
*** 93,100 ****
// is this page accessible only by admins ?
! if (in_array(0, $this->perms))
{
// yes, access denied
header("Location: " . $uc_info["adminsOnly"]);
}
--- 94,102 ----
// is this page accessible only by admins ?
! if (in_array(ADMINS_GID, $this->perms))
{
// yes, access denied
header("Location: " . $uc_info["adminsOnly"]);
+ exit();
}
***************
*** 102,106 ****
// or is the page accessible by everybody ?
if (count(array_intersect($userGroups, $this->perms)) > 0
! || in_array(1, $this->perms))
{
// yes, access granted and user logged in
--- 104,108 ----
// or is the page accessible by everybody ?
if (count(array_intersect($userGroups, $this->perms)) > 0
! || in_array(ALL_GID, $this->perms))
{
// yes, access granted and user logged in
***************
*** 110,113 ****
--- 112,116 ----
// No access has been granted
header("Location: " . $uc_info["accessDenied"]);
+ exit();
}
|
|
From: <jhe...@us...> - 2002-11-28 14:23:27
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv3824
Modified Files:
uc_sql-mysql.inc
Log Message:
modified some queries to fit the new account management system
Index: uc_sql-mysql.inc
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/lib/uc_sql-mysql.inc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** uc_sql-mysql.inc 21 Nov 2002 15:17:06 -0000 1.8
--- uc_sql-mysql.inc 28 Nov 2002 14:23:24 -0000 1.9
***************
*** 7,13 ****
$ucsql_groupadd = "INSERT INTO $groups_tbl (groupname) VALUES ('%s')";
! $ucsql_groupdel = "DELETE FROM $groups_tbl WHERE groupname='%s'";
! $ucsql_groupget = "SELECT * FROM $groups_tbl WHERE groupname='%s'";
! $ucsql_allgroups = "SELECT * FROM $groups_tbl";
$ucsql_primarygroup = "SELECT $groups_tbl.gid FROM $users_tbl, $groups_tbl"
. " WHERE $groups_tbl.groupname='%s'"
--- 7,14 ----
$ucsql_groupadd = "INSERT INTO $groups_tbl (groupname) VALUES ('%s')";
! $ucsql_groupdel = "DELETE FROM $groups_tbl WHERE gid='%s'";
! $ucsql_groupget = "SELECT * FROM $groups_tbl"
! . " WHERE (groupname = '%s' OR gid = '%s')";
! $ucsql_allgroups = "SELECT * FROM $groups_tbl ORDER BY groupname";
$ucsql_primarygroup = "SELECT $groups_tbl.gid FROM $users_tbl, $groups_tbl"
. " WHERE $groups_tbl.groupname='%s'"
***************
*** 15,20 ****
! $ucsql_useradd = "INSERT INTO $users_tbl (username) VALUES ('%s')";
! $ucsql_userdel = "DELETE FROM $users_tbl WHERE username='%s'";
$ucsql_userget = "SELECT u.* FROM $users_tbl AS u"
--- 16,27 ----
! $ucsql_useradd = "INSERT INTO $users_tbl"
! . " (username,groupid,lastname,firstname,preferred_lang,email)"
! . " VALUES ('%s','%s','%s','%s','%s','%s')";
! $ucsql_userupdate = "UPDATE $users_tbl SET username = '%s', groupid = '%s',"
! . " lastname = '%s', firstname = '%s', preferred_lang = '%s',"
! . " email = '%s' WHERE uid = '%s'";
!
! $ucsql_userdel = "DELETE FROM $users_tbl WHERE uid='%s'";
$ucsql_userget = "SELECT u.* FROM $users_tbl AS u"
***************
*** 43,50 ****
. " SET email='%s' WHERE uid='%s'";
! $ucsql_memberadd = "INSERT INTO $members_tbl (gid, uid) VALUES ('%s', '%s')";
$ucsql_memberdel = "DELETE FROM $members_tbl WHERE gid = '%s' AND uid = '%s'";
$ucsql_memgrpdel = "DELETE FROM $members_tbl WHERE gid = '%s'";
$ucsql_memberrm = "DELETE FROM $members_tbl WHERE uid='%s'";
--- 50,58 ----
. " SET email='%s' WHERE uid='%s'";
! $ucsql_memberadd = "INSERT INTO $members_tbl (gid, uid) VALUES ";
$ucsql_memberdel = "DELETE FROM $members_tbl WHERE gid = '%s' AND uid = '%s'";
$ucsql_memgrpdel = "DELETE FROM $members_tbl WHERE gid = '%s'";
$ucsql_memberrm = "DELETE FROM $members_tbl WHERE uid='%s'";
+ $ucsql_memberget = "SELECT gid FROM $members_tbl WHERE uid = '%s'";
|
|
From: <jhe...@us...> - 2002-11-28 14:22:17
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv2954
Modified Files:
uc_accounts.php
Added Files:
uc_user.php uc_group.php
Log Message:
use of an account manager objectto handle user and group objects
--- NEW FILE: uc_user.php ---
<?php
include_once("lib/uc_sql.php");
class UcUser
{
var $name;
var $uid;
var $gid;
var $secGids;
var $firstName;
var $lastName;
var $email;
var $lang;
var $accountMgr;
var $newUser;
function UcUser(&$accountMgr)
{
$this->accountMgr = $accountMgr;
}
function getSecondaryGroups()
{
return $this->secGids;
}
function setPassword($passwd)
{
$this->accountMgr->setUserPassword($this, $password);
$password = '';
}
function setLanguage($lang)
{
$this->lang = $lang;
}
function setPrimaryGroup($gid)
{
$this->gid = $gid;
}
function setSecondaryGroups($gids)
{
$this->secGids = $gids;
}
function setFirstName($name)
{
$this->firstName = $name;
}
function setLastName($name)
{
$this->lastName = $name;
}
function setEmail($email)
{
$this->email = $email;
}
}
?>
--- NEW FILE: uc_group.php ---
<?php
class UcGroup
{
var $name;
var $gid;
var $accountMgr;
function UcGroup(&$accountMgr, $name)
{
$this->name = $name;
$this->accountMgr = $accountMgr;
$this->gid = -1;
}
}
?>
Index: uc_accounts.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/lib/uc_accounts.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** uc_accounts.php 8 Aug 2002 13:50:17 -0000 1.4
--- uc_accounts.php 28 Nov 2002 14:22:14 -0000 1.5
***************
*** 1,179 ****
<?php
! include_once("lib/uc_sql.php");
!
! class UcUser
{
- var $name;
- var $uid;
- var $gid;
- var $lang;
- var $groups;
var $db;
! var $firstName;
! var $lastName;
! var $email;
! function UcUser()
! {
! $this->groups = array();
! $this->db = new UcSql();
}
! function getSecondaryGroups()
{
! global $ucsql_usergroups;
! $query = sprintf($ucsql_usergroups, $this->uid);
!
! $res = $this->db->Execute($query) or
! die("Unable to get groups: " . $db->ErrorMsg());
!
! unset($this->groups);
! $this->groups = array();
!
! while ($o = $res->FetchNextObject(true))
! $this->groups[] = $o->GID;
! return $this->groups;
}
! function setPassword($passwd)
{
! global $ucsql_usersetpw;
! $query = sprintf($ucsql_usersetpw, $passwd, $this->uid);
! $this->db->Execute($query) or die("Unable to set user password: "
! . $this->db->ErrorMsg());
}
! function setLanguage($lang)
{
! global $ucsql_usersetlang;
! $query = sprintf($ucsql_usersetlang, $lang, $this->uid);
! $this->db->Execute($query) or die("Unable to set user lang: "
! . $this->db->ErrorMsg());
! $this->lang = $lang;
}
! function setPrimaryGroup($gid)
{
! global $ucsql_usersetgid;
! $query = sprintf($ucsql_usersetgid, $gid, $this->uid);
! $res = $this->db->Execute($query)
! or die("Unable to set user primary group: "
! . $this->db->ErrorMsg());
! $this->gid = $gid;
}
! function setSecondaryGroups($gids)
{
! global $ucsql_memberrm;
! global $ucsql_memberadd;
!
! $query = sprintf($ucsql_memberrm, $this->uid);
! $this->db->Execute($query) or die("Unable to reset user memberships: "
! . $this->db->ErrorMsg());
! foreach ($gids as $gid)
! {
! $query = sprintf($ucsql_memberadd, $gid,$this->uid);
! $this->db->Execute($query) or die("Unable to add membership: "
! . $thid->db->ErrorMsg());
! }
!
! $this->groups = $gids;
}
! function setFirstName($name)
{
! global $ucsql_userfirstname;
! $query = sprintf($ucsql_userfirstname, $name, $this->uid);
! $this->db->Execute($query) or die("Unable to set user's first name: "
! . $this->db->ErrorMsg());
! $this->firstName = $name;
}
!
! function setLastName($name)
{
! global $ucsql_userlastname;
! $query = sprintf($ucsql_userlastname, $name, $this->uid);
! $this->db->Execute($query) or die("Unable to set user's last name : "
! . $this->db->ErrorMsg());
! $this->lastName = $name;
}
!
! function setEmail($email)
{
! global $ucsql_useremail;
! $query = sprintf($ucsql_useremail, $email, $this->uid);
! $this->db->Execute($query) or die("Unable to set user's email: "
! . $this->db->ErrorMsg());
! $this->email = $email;
}
- }
-
! // Fill a user object with data retrieved from the database
! function getUser($username, $uid)
! {
! global $ucsql_userget;
!
! $db = new UcSQL();
!
! // retrieving the user
! $query = sprintf($ucsql_userget, $username, $uid);
! $res = $db->Execute($query) or die("Unable to get user $username, $uid: "
! . $db->ErrorMsg());
! if ($res->RecordCount() != 1)
{
! print("FOUND: " . $res->RecordCount() . "<br>");
! die("Problem with your database: more than one user with same uid");
}
! $o = $res->FetchNextObject(TRUE);
!
! $user = new UcUser();
! $user->name = $o->USERNAME;
! $user->uid = $o->UID;
! $user->gid = $o->GROUPID;
! $user->lang = $o->PREFERRED_LANG;
! $user->groups = $user->getSecondaryGroups();
! $user->firstName = $o->FIRSTNAME;
! $user->lastName = $o->LASTNAME;
! $user->email = $o->EMAIL;
! return $user;
! }
! // Create a new user in the database
! function createUser($username)
! {
! global $ucsql_useradd;
! global $ucsql_userget;
! $db = new UcSql();
! $query = sprintf($ucsql_useradd, $username);
! $db->Execute($query) or die("Unable to create new user: "
! . $db->ErrorMsg());
!
! return getUser($username, '');
! }
!
!
! function getAllGroups()
! {
! global $ucsql_allgroups;
! $db = new UcSql();
! $query = $ucsql_allgroups;
! $res = $db->Execute($query) or die("Unable to get group list: "
! . $db->ErrorMsg());
! $groups = array();
! while ($o = $res->FetchNextObject(TRUE))
{
! $groups[$o->GID] = $o->GROUPNAME;
}
- return $groups;
}
--- 1,246 ----
<?php
+ include_once("uc_sql.php");
+ include_once("uc_user.php");
+ include_once("uc_group.php");
! class UcAccountManager
{
var $db;
! var $cfg;
!
! function UcAccountManager(&$db)
! {
! $this->cfg = $GLOBALS["ucConfig"];
! if ($db == null)
! $this->db = new UcSql();
! else
! $this->db = $db;
! }
! // Users account methods
!
! // Factory method : Create a new user
! function createUser($username)
! {
! $user = new UcUser($this);
! $user->name = $username;
! $user->gid = $this->cfg->defaultGroup;
! $user->lang = $this->cfg->defaultLang;
! $user->secGids = array();
! $user->lastName = '';
! $user->firstName = '';
! $user->email = '';
! $user->uid = -1;
! $user->newUser = true;
! return $user;
}
! function anonymousUser()
{
! $user = new UcUser($this);
! $user->name = "anonymous";
! $user->uid = -1;
! $user->gid = -1;
! $user->lang = $this->cfg->defaultLang;
! $user->groups = array();
! return $user;
}
!
! function setSecondaryGroups(&$user)
{
! if ($user->uid == -1)
! $u = $this->getUser($user->name);
! else
! $u =& $user;
! $this->removeMember($u);
! if (count($u->secGids) > 0)
! {
! $ar = array();
! foreach ($u->secGids as $gid)
! $ar[] = "('" . $gid . "', '" . $u->uid . "')";
! $gidsStr = join(",", $ar);
! $query = $GLOBALS["ucsql_memberadd"] . $gidsStr;
! $this->db->Execute($query)
! or die("Unable to set memberships for user: "
! . $this->db->ErrorMsg());
! }
! }
! function getSecondaryGroups(&$user)
! {
! $query = sprintf($GLOBALS["ucsql_memberget"], $user->uid);
! $res = $this->db->Execute($query)
! or die("Unable to get user memberships: "
! . $this->db->ErrorMsg());
! $gids = array();
! while (($o = $res->FetchNextObject(TRUE)))
! $gids[] = $o->GID;
! return $gids;
}
! // add a user to the database
! // return a new user object with data retrieve from the db
! function addUser($user)
{
! $query = sprintf($GLOBALS["ucsql_useradd"],
! $user->name, $user->gid, $user->lastName, $user->firstName,
! $user->lang, $user->email);
! $this->db->Execute($query)
! or die("Unable to add user: " . $this->db->ErrorMsg());
! $this->setSecondaryGroups($user);
! return $this->getUser($user->name);
! }
! // update user data in the database
! // return a new user object with data retrieved from the database
! function updateUser($user)
! {
! $query = sprintf($GLOBALS["ucsql_userupdate"],
! $user->name, $user->gid, $user->lastName, $user->firstName,
! $user->lang, $user->email, $user->uid);
! print("<B>QUERY: $query</B><br>");
! $this->db->Execute($query)
! or die("Unable to update user: " . $this->db->ErrorMsg());
! $this->setSecondaryGroups($user);
! return $this->getUser($user->name);
! }
! // Fill a user object with data retrieved from the database
! function getUser($username, $uid = '')
! {
! // retrieving the user
! $query = sprintf($GLOBALS["ucsql_userget"], $username, $uid);
! $res = $this->db->Execute($query)
! or die("Unable to get user $username, $uid: "
! . $this->db->ErrorMsg());
! if ($res->RecordCount() != 1)
! die("Problem with your database: more than one user with same uid");
!
! $o = $res->FetchNextObject(TRUE);
!
! $user = new UcUser($this);
! $user->name = $o->USERNAME;
! $user->uid = $o->UID;
! $user->gid = $o->GROUPID;
! $user->lang = $o->PREFERRED_LANG;
! $user->firstName = $o->FIRSTNAME;
! $user->lastName = $o->LASTNAME;
! $user->email = $o->EMAIL;
! $user->secGids = $this->getSecondaryGroups($user);
! $user->newUser = false;
! return $user;
}
! function deleteUser(&$user)
{
! $this->removeMember($user);
! $query = sprintf($GLOBALS["ucsql_userdel"], $user->uid);
! $this->db->Execute($query)
! or die("Unable to remove user: " . $this->db->ErrorMsg());
! }
! function listUsers()
! {
! $query = $GLOBALS["ucsql_allusers"];
! $res = $this->db->Execute($query)
! or die("Unable to list users: " . $this->db->ErrorMsg());
! $ret = array();
! while (($o = $res->FetchNextObject(true)))
! $ret[] = $o->USERNAME;
! return $ret;
}
! function setUserPassword($user, $password)
{
! $query = sprintf($GLOBALS["ucsql_usersetpw"], $password, $user->uid);
! $password = '';
! $this->db->Execute($query)
! or die("Unable to set password: " . $this->db->ErrorMsg());
}
! function checkUserPassword($username, $password)
{
! $query = sprintf($GLOBALS["ucsql_usercheckpw"], $username, $password);
! $res = $this->db->Execute($query)
! or die("Unable to check password: " . $this->db->ErrorMsg());
! if ($res->RowCount() != 1)
! return false;
! else
! return true;
}
!
! // Groups methods
! function createGroup($name)
{
! $g = new UcGroup($this, $name);
! return $g;
}
!
! function addGroup($group)
{
! $query = sprintf($GLOBALS["ucsql_groupadd"], $group->name);
! $this->db->Execute($query)
! or die("Unable to create group $name: " . $this->db->ErrorMsg());
! return $this->getGroup($group->name);
}
! function getGroup($name, $gid = '')
{
! $query = sprintf($GLOBALS["ucsql_groupget"], $name, $gid);
! $res = $this->db->Execute($query)
! or die("Unable to get group $name, $gid: "
! . $this->db->ErrorMsg());
! if ($res->RowCount() != 1)
! die("Problem with your DB, more than one group fetched");
! $o = $res->FetchNextObject(true);
! $g = new UcGroup($this, $o->GROUPNAME);
! $g->gid = $o->GID;
! return $g;
}
! function removeMember(&$user)
! {
! $query = sprintf($GLOBALS["ucsql_memberrm"], $user->uid);
! $this->db->Execute($query)
! or die("Unable to remove memberships: " . $this->db->ErrorMsg());
! }
! function isPrimaryGroup($group)
! {
! $query = sprintf($GLOBALS["ucsql_primarygroup"], $group->name);
! $res = $this->db->Execute($query)
! or die("Unable to check if group $group->name is primary group: "
! . $this->db->ErrorMsg());
! if ($res->RowCount() == 0)
! return false;
! else
! return true;
! }
! function deleteGroup($group)
! {
! if ($this->isPrimaryGroup($group))
! return false;
! $query = sprintf($GLOBALS["ucsql_groupdel"], $group->gid);
! $this->db->Execute($query)
! or die("Unable to delete group $group->name: "
! . $this->db->ErrorMsg());
! return true;
! }
! function listGroups()
{
! global $ucsql_allgroups;
! $db = new UcSql();
! $query = $ucsql_allgroups;
! $res = $db->Execute($query) or die("Unable to get group list: "
! . $db->ErrorMsg());
! $groups = array();
! while ($o = $res->FetchNextObject(TRUE))
! $groups[$o->GID] = $o->GROUPNAME;
! return $groups;
}
}
|
|
From: <jhe...@us...> - 2002-11-22 13:45:39
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv15689
Modified Files:
uc_session.php
Log Message:
create a session record only if the session id is not empty. Avoid records with
empty session
Index: uc_session.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/lib/uc_session.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** uc_session.php 12 Nov 2002 11:08:29 -0000 1.4
--- uc_session.php 22 Nov 2002 13:45:36 -0000 1.5
***************
*** 6,11 ****
//include_once("lib/uc_session_handler.php");
-
-
class UcSession
{
--- 6,9 ----
***************
*** 16,20 ****
var $returnPath;
! function UcSession($returnPath)
{
global $ucsql_sessioncreate;
--- 14,18 ----
var $returnPath;
! function UcSession($uri)
{
global $ucsql_sessioncreate;
***************
*** 31,40 ****
$this->db = new UcSql();
! $this->returnPath = $returnPath;
$query = sprintf($ucsql_sessionget, $this->sessid);
$res = $this->db->Execute($query) or die("Unable to check session: "
. $this->db->ErrorMsg());
! if ($res->RowCount() == 0)
{
// Create a record for this session in the db
--- 29,40 ----
$this->db = new UcSql();
! $ar = parse_url($uri);
!
! $this->returnPath = $ar["path"];
$query = sprintf($ucsql_sessionget, $this->sessid);
$res = $this->db->Execute($query) or die("Unable to check session: "
. $this->db->ErrorMsg());
! if ($res->RowCount() == 0 && !empty($this->sessid))
{
// Create a record for this session in the db
|
|
From: <jhe...@us...> - 2002-11-22 13:34:23
|
Update of /cvsroot/upcase-project/UpCase/lib In directory sc8-pr-cvs1:/tmp/cvs-serv14955 Modified Files: uc_page.php Log Message: give the whole URI to the session object Index: uc_page.php =================================================================== RCS file: /cvsroot/upcase-project/UpCase/lib/uc_page.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** uc_page.php 12 Nov 2002 13:51:59 -0000 1.3 --- uc_page.php 22 Nov 2002 13:34:20 -0000 1.4 *************** *** 24,30 **** $ar = parse_url($REQUEST_URI); $this->path = $ar["path"]; // Open the session ! $this->session = new UcSession($this->path); $this->session->lang = $ucConfig->defaultlang; --- 24,31 ---- $ar = parse_url($REQUEST_URI); $this->path = $ar["path"]; + $this->uri = $REQUEST_URI; // Open the session ! $this->session = new UcSession($this->uri); $this->session->lang = $ucConfig->defaultlang; |