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-13 08:41:35
|
Update of /cvsroot/upcase-project/UpCase/templates/en In directory usw-pr-cvs1:/tmp/cvs-serv1943 Modified Files: badlogin.mxt useredit.mxt userslist.mxt Added Files: category.mxt groupdel.mxt groupwarn.mxt installer.mxt mainpage.mxt menu.mxt myaccount.mxt newgroup.mxt newuser.mxt repository.mxt Log Message: added some templates --- NEW FILE: category.mxt --- <html> <head> </head> <body> <h1 align="center"><mx:text id="catdescr" /></h1> <mx:bloc id="packages"> <center> <table border="0" width="50%"> <tr bgcolor="7777FF"> <th width="50%">Package Name</th> <th>Available Version</th> </tr> <tr> <td align="center"><mx:text id="pkgname" /></td> <td align="center"><mx:text id="pkgver" /></td> </tr> <tr bgcolor="AAAAAA"> <td align="center"> <a mxAttribut="href:installer">Install</a> </td> <td align="center">Upgrade</td> </tr> <tr bgcolor="9999FF"> <th colspan="2">Description</th> </tr> <tr> <td colspan="2"><mx:text id="pkgdescr" /></td> </tr> <tr bgcolor="CCCCCC"> <th>Home Page</th> <td align="center"> <a mxAttribut="href:pkghome"><mx:text id="pkghome" /></a> </td> </tr> <tr bgcolor="9999FF"> <th colspan="2">On this site</th> </tr> <tr> <td align="center" colspan="2"> <table width="100%"> <mx:bloc id="instances"> <tr bgcolor="EEEEEE"> <td width="33%" align="center"><mx:text id="pkgver" /></td> <td width="33%" align="center"><mx:text id="pkgurl" /></td> <td width="33%" align="center"><mx:text id="pkgstatus" /></td> </tr> </mx:bloc id="instances"> </table> </td> </tr> </table> </center> <hr> </mx:bloc id="packages"> </body> </html> --- NEW FILE: groupdel.mxt --- <html> <head> <title>Group Deletion</title> </head> <body> <h1>Group <mx:text id="groupname" /> succesfully deleted</h1> </body> </html> --- NEW FILE: groupwarn.mxt --- <html> <head> </head> <body> <h1>This group is the primary group for some users. You can't remove it</h1> </body> </html> --- NEW FILE: installer.mxt --- <html> <head> <title>Installer</title> </head> <body> <h1>Installing package <mx:text id="pkgname" /></h1> <form mxAttribut="action:installer"> <input type="hidden" name="cat" value="<mx:text id="catname" />"> <input type="hidden" name="pkg" value="<mx:text id="pkgname" />"> <center> <table> <tr> <th align="left">URL :</th> <td colspan="2"> <mx:text id="siteroot" /> <input type="text" name="pkgurl" value="<mx:text id="pkgname" />"> </td> </tr> <tr> <th align="left">Table prefix : </th> <td colspan="2"> <input type="text" name="tblprefix" value="<mx:text id="pkgname" />">_</td> </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> </form> </body> </html> --- NEW FILE: mainpage.mxt --- <html> <head> <title>Main Page</title> </head> <body> <h1>Welcome to the Dark Side of UpCase</h1> <div> In this part of your web site, you will find all what you need for some administrative tasks : <ul> <li>Installing new software</li> <li>Management of users account</li> <li>Management of the UpCase software itself</li> <li>Links to installed applications</li> </ul> You must log in to see what functionnalities are available to you. </div> </body> </html> --- NEW FILE: menu.mxt --- <html> <head> <title>Menu</title> </head> <body mXattribut="onload:contentframe"> <mx:bloc id="login"> </mx:bloc id="login"> <mx:bloc id="menu"> </mx:bloc id="menu"> </body> </html> --- NEW FILE: myaccount.mxt --- <html> <head> <title>Personnal Account Settings</title> </head> <body> <h1 align="center">Personnal Account Settings</h1> <center> <form> <table> <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> <td>Current Password : </td> <td><input type="text" name="curpwd"></td> </tr> <tr> <td>New password : </td> <td><input type="text" name="newpwd"></td> </tr> <tr> <td>Confirm : </td> <td><input type="text" name="confirm"></td> </tr> <tr> <td colspan="2"><center><input type="submit" value="Apply Changes"></center></td> </tr> </table> </form> </center> </body> </html> --- NEW FILE: newgroup.mxt --- <html> <head> <title>New group</title> </head> <body> <h1>Group <mx:text id="groupname" /> created successfully</h1> </body> </html> --- NEW FILE: newuser.mxt --- <html> <head> <title>New User</title> </head> <body> <form> <table> <tr> <td>User name : </td><td><input type="text" name="newuser" /></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" /></td> </tr> </table> </form> </body> </html> --- NEW FILE: repository.mxt --- <html> <head> </head> <body> <h1>repository</h1> <mx:text id="descr" /> <br><a mxAttribut="href:repupdate">Update</a> <h2>Available categories are</h2> <ul> <mx:bloc id="categories"> <li> <a mxAttribut="href:caturl"> <mx:text id="catname" /> </a> </li> </mx:bloc id="categories"> </ul> </body> </html> Index: badlogin.mxt =================================================================== RCS file: /cvsroot/upcase-project/UpCase/templates/en/badlogin.mxt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** badlogin.mxt 16 Jul 2002 15:32:15 -0000 1.1.1.1 --- badlogin.mxt 13 Nov 2002 08:41:31 -0000 1.2 *************** *** 6,10 **** <body> <h1 align="center">Bad Login</h1> ! You have entered a bad Login / Password pair. </body> </html> --- 6,11 ---- <body> <h1 align="center">Bad Login</h1> ! You have entered a bad Login / Password pair.<br> ! <a mXattribut="href:back">Back</a> </body> </html> Index: useredit.mxt =================================================================== RCS file: /cvsroot/upcase-project/UpCase/templates/en/useredit.mxt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** useredit.mxt 16 Jul 2002 15:32:15 -0000 1.1.1.1 --- useredit.mxt 13 Nov 2002 08:41:31 -0000 1.2 *************** *** 5,9 **** <body> ! <h1>User Edition</h1> <form mxAttribut="action:next"> --- 5,9 ---- <body> ! <h1>Account settings for <mx:text id="username" /></h1> <form mxAttribut="action:next"> *************** *** 11,15 **** <tr> ! <td>Username : </td><td><mx:text id="username" /></td> </tr> --- 11,26 ---- <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> *************** *** 29,37 **** <td>Preferred language : </td><td><mx:select id="preflang" /></td> <tr> ! <td colspan="2"><input type="submit" /></td></tr> </table> </form> ! </body> </html> --- 40,49 ---- <td>Preferred language : </td><td><mx:select id="preflang" /></td> <tr> ! <td colspan="2"><input type="submit" value="Apply Changes" /></td></tr> </table> </form> ! <hr> ! <a href="userslist.php">Back</a> </body> </html> Index: userslist.mxt =================================================================== RCS file: /cvsroot/upcase-project/UpCase/templates/en/userslist.mxt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** userslist.mxt 16 Jul 2002 15:32:14 -0000 1.1.1.1 --- userslist.mxt 13 Nov 2002 08:41:31 -0000 1.2 *************** *** 1,24 **** <html> <head> ! <title><mx:text id="upcase" />::Users List</title> </head> <body> - <h1>Users List</h1> <table> ! <mx:bloc id="users_list"> <tr> ! <td><a mxAttribut="href:useredit" target="useredit"> ! <mx:text id="user" /> ! </a> </td> </tr> ! </mx:bloc id="users_list"> </table> </body> </html> --- 1,75 ---- <html> <head> ! <title><mx:text id="upcase" />::Accounts Management</title> </head> <body> + <h1 align="center">Accounts Management</h1> + + <center> + <h3 align="center">Account Creation</h3> + <form action="newuser.php"> <table> + <tr> + <td>Enter new user login name : <input type="text" name="newuser"></td> + <td><input type="submit" value="Create"></td> + </tr> + </table> + </form> + </center> + <hr width="75%"> ! <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> + <td><input type="submit" value="Go"></td> </tr> ! </table> ! </form> ! </center> ! ! <hr> + <h1 align="center">Groups Management</h1> + <h3 align="center">Group Creation</h3> + <center> + <form action="newgroup.php"> + <table> + <tr> + <td>Enter new group name : <input type="text" name="newgroup"></td> + <td><input type="submit" value="Create"></td> + </tr> </table> + </form> + </center> + <hr width="75%"> + <h3 align="center">Group Deletion</h3> + <center> + <form action="groupdel.php"> + <table> + <tr> + <td>Select a group : + <select name="groupname"> + <mx:bloc id="groupList"> + <option value="<mx:text id="group" />"><mx:text id="group" /></option> + </mx:bloc id="groupList"> + <select> + </td> + <td><input type="submit" value="Delete"></td> + </tr> + </table> + </form> </body> </html> |
|
From: <jhe...@us...> - 2002-11-13 08:40:22
|
Update of /cvsroot/upcase-project/UpCase/templates/en/blocs In directory usw-pr-cvs1:/tmp/cvs-serv1371/blocs Log Message: Directory /cvsroot/upcase-project/UpCase/templates/en/blocs added to the repository |
|
From: <jhe...@us...> - 2002-11-12 18:17:38
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory usw-pr-cvs1:/tmp/cvs-serv765
Added Files:
userslist.php
Log Message:
users listing
--- NEW FILE: userslist.php ---
<?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");
$page->open();
include("config/uc_templates.inc");
$tmpl = new ModeliXe($uc_tmpl["USERS_LIST"]);
$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");
$tmpl->MxUrl("newuser", "newuser.php");
$tmpl->MxWrite();
?>
|
|
From: <jhe...@us...> - 2002-11-12 17:56:20
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory usw-pr-cvs1:/tmp/cvs-serv20228
Modified Files:
useredit.php
Log Message:
corrected bug with secondary groups display
Index: useredit.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/admin/useredit.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** useredit.php 8 Aug 2002 13:47:48 -0000 1.2
--- useredit.php 12 Nov 2002 17:56:17 -0000 1.3
***************
*** 33,36 ****
--- 33,39 ----
if (isset($secondarygroups))
$user->setSecondaryGroups($secondarygroups);
+ else
+ $user->setSecondaryGroups(array());
+
if (strlen($password) > 0)
$user->setPassword($password);
***************
*** 54,58 ****
$tmpl->MxText("email", $user->email);
- $tmpl->MxAttribut("userupdate", "userupdate.php");
$tmpl->MxWrite();
--- 57,60 ----
|
|
From: <jhe...@us...> - 2002-11-12 17:54:03
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory usw-pr-cvs1:/tmp/cvs-serv19216
Added Files:
userdel.php
Log Message:
user deletion
--- NEW FILE: userdel.php ---
<?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();
?>
|
|
From: <jhe...@us...> - 2002-11-12 17:53:16
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory usw-pr-cvs1:/tmp/cvs-serv18606
Added Files:
repository.php
Log Message:
packages repository view
--- NEW FILE: repository.php ---
<?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("repository");
// 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");
// 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["REPOSITORY"]);
$tmpl->SetModeliXe();
$rep = new UcLocalRepository();
if (!empty($doupdate))
$rep->update();
$tmpl->MxUrl("repupdate", $ucConfig->wwwRoot . "/admin/repository.php?doupdate=1");
$tmpl->MxText("descr", $rep->description[$user->lang]);
$categories = $rep->getCategories();
foreach ($categories as $category)
{
$tmpl->MxText("categories.catname", $category->description[$user->lang]);
$tmpl->MxUrl("categories.caturl",
$ucConfig->wwwRoot . "/admin/category.php",
array("catname" => $category->name));
$tmpl->MxBloc("categories", "loop");
}
// output
$tmpl->MxWrite();
?>
|
|
From: <jhe...@us...> - 2002-11-12 17:52:30
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory usw-pr-cvs1:/tmp/cvs-serv18256
Modified Files:
permissions.php
Log Message:
adjusted includes
Index: permissions.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/admin/permissions.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** permissions.php 16 Jul 2002 15:31:53 -0000 1.1.1.1
--- permissions.php 12 Nov 2002 17:52:27 -0000 1.2
***************
*** 11,15 ****
// updateperms : the name of the action script for the from (currently this one)
// submit : name of the submit button
!
include_once("lib/uc_page.php");
--- 11,15 ----
// updateperms : the name of the action script for the from (currently this one)
// submit : name of the submit button
! include_once("../config/uc_config.inc");
include_once("lib/uc_page.php");
|
|
From: <jhe...@us...> - 2002-11-12 17:51:26
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory usw-pr-cvs1:/tmp/cvs-serv17584
Added Files:
newuser.php
Log Message:
user account creation
--- NEW FILE: newuser.php ---
<?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->wwwRoot
. "/admin/useredit.php?username=$newuser&sessid=$sessid");
}
include("config/uc_templates.inc");
$tmpl = new ModeliXe($uc_tmpl["NEW_USER"]);
$tmpl->SetModeliXe();
$tmpl->MxWrite();
?>
|
|
From: <jhe...@us...> - 2002-11-12 17:48:54
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory usw-pr-cvs1:/tmp/cvs-serv15991
Added Files:
newgroup.php
Log Message:
group creation
--- NEW FILE: newgroup.php ---
<?php
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();
?>
|
|
From: <jhe...@us...> - 2002-11-12 17:47:56
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory usw-pr-cvs1:/tmp/cvs-serv15426
Added Files:
myaccount.php
Log Message:
user's account edition form
--- NEW FILE: myaccount.php ---
<?php
include_once("../config/uc_config.inc");
include_once("lib/uc_page.php");
$page = new UcPage("myAccount");
$page->open();
$user = $page->session->getUser();
if ($user->uid == -1)
{
header("Location: " . $uc_info["notLoggedIn"]);
exit();
}
if ($page->session->checkPassword($user->name, $curpwd))
{
if (!empty($firstname))
$user->setFirstName($firstname);
if (!empty($lastname))
$user->setLastName($lastname);
if (!empty($email))
$user->setEmail($email);
if (!empty($newpwd) && !empty($confirm))
{
if ($newpwd == $confirm)
$user->setPassword($newpwd);
else
die("Passwords mismatch");
}
}
include("config/uc_templates.inc");
$tmpl = new ModeliXe($uc_tmpl["MY_ACCOUNT"]);
$tmpl->SetModeliXe();
$tmpl->MxText("firstname", $user->firstName);
$tmpl->MxText("lastname", $user->lastName);
$tmpl->MxText("email", $user->email);
$tmpl->MxWrite();
?>
|
|
From: <jhe...@us...> - 2002-11-12 17:47:02
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory usw-pr-cvs1:/tmp/cvs-serv14870
Added Files:
menu.php
Log Message:
menu generation
--- NEW FILE: menu.php ---
<?php
include_once("../config/uc_config.inc");
include_once("lib/uc_page.php");
$page = new UcPage("menu");
$page->open();
$sess = $page->getSession();
if (!empty($logout))
{
$sess->logout();
header("Location: " . $ucConfig->wwwRoot . "/admin/menu.php?content=main.php");
}
if (!empty($username) && !empty($password))
{
$sess->login($username, $password);
}
$user = $sess->getUser();
$userGroups = $user->groups;
$userGroups[] = $user->gid;
include("config/uc_templates.inc");
$tmpl = new ModeliXe($uc_tmpl["MENU"]);
$tmpl->SetModeliXe();
$tmpl->SetMxSession(SID);
if (!empty($content))
$tmpl->MxAttribut("contentframe", "JavaScript:parent.content.location.href = '$content'");
// Login / logout box
if ($user->uid == -1)
{
$tmpl->MxBloc("login", "modify", "../templates/" . $uc_tmpl['LOGIN']);
}
else
{
$tmpl->MxBloc("login", "modify", "../templates/" . $uc_tmpl['LOGOUT']);
$tmpl->MxUrl("login.logout", $ucConfig->wwwRoot
. "/admin/menu.php", array( "logout" => "1"));
$tmpl->MxText("login.username", $user->name);
$tmpl->MxUrl("login.myaccount", "myaccount.php");
}
// Menu generation
$tmpl->MxBloc("menu", "append", "../templates/" . $uc_tmpl['APP_MENU']);
$apps = array( "WebCalendar" => $ucConfig->wwwModules . "/WebCalendar",
"Owl" => $ucConfig->wwwModules . "/Owl",
"phpBB" => $ucConfig->wwwModules . "/phpBB2",
"SPIP" => $ucConfig->wwwModules . "/SPIP");
foreach ($apps as $appName => $appUrl)
{
$tmpl->MxText("menu.appmenu.application", $appName);
$tmpl->MxUrl("menu.appmenu.appurl", $appUrl);
$tmpl->MxBloc("menu.appmenu", "loop");
}
// append administrative menu items
if ($user->uid != -1)
{
$tmpl->MxBloc("menu", "append", "../templates/"
. $uc_tmpl['ADMIN_MENU']);
$tmpl->MxUrl("menu.packages", "packages.php", "");
$tmpl->MxUrl("menu.accounts", "userslist.php");
$tmpl->MxUrl("menu.permissions", "permissions.php");
}
$tmpl->MxWrite();
?>
|
|
From: <jhe...@us...> - 2002-11-12 17:46:05
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory usw-pr-cvs1:/tmp/cvs-serv14335
Added Files:
main.php
Log Message:
main page
--- NEW FILE: main.php ---
<?php
include_once("../config/uc_config.inc");
include_once("lib/uc_page.php");
$page = new UcPage("mainPage");
$page->open();
$sess = $page->getSession();
$user = $sess->getUser();
include("config/uc_templates.inc");
$tmpl = new ModeliXe($uc_tmpl['MAIN_PAGE']);
$tmpl->SetModeliXe();
$tmpl->MxWrite();
?>
|
|
From: <jhe...@us...> - 2002-11-12 17:44:47
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory usw-pr-cvs1:/tmp/cvs-serv13497
Added Files:
installer.php
Log Message:
installer interface
--- NEW FILE: installer.php ---
<?php
include_once("../config/uc_config.inc");
// First lines to include
include_once("lib/uc_page.php");
// Start the session
$p = new UcPage("installer");
// Check permissions, log in if necessary
$p->open();
$sess = $p->getSession();
$user = $sess->getUser();
// other includes
include_once("lib/uc_utils.php");
include_once("lib/uc_repository.php");
include_once("lib/uc_installer.php");
$rep = new UcLocalRepository();
$inst = new UcInstaller();
// Check HTTP input vars
$catname = checkVarIn("cat", $rep->categories, false)
or die("Invalid category");
$category = $rep->getCategory($catname);
if (!$category)
die("Invalid category");
$pkgname = checkVarIn("pkg", $category->packages, false)
or die("Invalid package1");
$package = $category->getPackage($pkgname);
if (!$package)
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
$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->wwwRoot . "/admin/installer.php");
$tmpl->MxText("pkgname", $package->name);
$tmpl->MxText("siteroot", $ucConfig->wwwModules . "/");
$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);
// $pkgAbsolutePath = $cfg->modulesRoot . "/" . $pkgRelUrl;
$inst->install($package, $pkgRelUrl, $tblPrefix);
}
else if ($operation == "upgrade")
{
die("Not yet implemented upgrade feature");
}
// output
//$tmpl->MxWrite();
?>
|
|
From: <jhe...@us...> - 2002-11-12 17:44:03
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory usw-pr-cvs1:/tmp/cvs-serv12718
Added Files:
groupdel.php
Log Message:
remove a group from the database. Checl if this group is used as primary group before removing
--- NEW FILE: groupdel.php ---
<?php
include_once("../config/uc_config.inc");
include_once("lib/uc_page.php");
include_once("lib/uc_sql.php");
$page = new UcPage("groupDelete");
$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();
?>
|
|
From: <jhe...@us...> - 2002-11-12 17:42:51
|
Update of /cvsroot/upcase-project/UpCase/admin
In directory usw-pr-cvs1:/tmp/cvs-serv11879
Added Files:
category.php
Log Message:
display content of a category of packages
--- NEW FILE: category.php ---
<?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();
$rep = new UcLocalRepository();
$inst = new UcInstaller();
$category = $rep->getCategory($catname);
if (!$category)
die("Invalid category");
$packages = $category->getPackages();
$tmpl->MxText("catdescr", $category->description[$user->lang]);
foreach ($packages as $package)
{
$tmpl->MxUrl("packages.pkgurl", $ucConfig->wwwRoot . "/admin/package.php",
array("name" => $package->name));
$tmpl->MxText("packages.pkgname", $package->name);
$tmpl->MxText("packages.pkgdescr", $package->description[$user->lang]);
$tmpl->Mxtext("packages.pkghome", $package->homePage);
$tmpl->MxUrl("packages.pkghome", $package->homePage);
$tmpl->MxText("packages.pkgver", $package->version);
$tmpl->MxUrl("packages.installer",
$ucConfig->wwwRoot . "/admin/installer.php",
array("cat" => $catname, "pkg" => $package->name));
$instances = $inst->getStatus($package);
foreach ($instances as $instance)
{
$tmpl->MxText("packages.instances.pkgver", $instance["version"]);
$tmpl->MxText("packages.instances.pkgurl", $instance["url"]);
$tmpl->MxText("packages.instances.pkgstatus", $instance["status"]);
$tmpl->MxBloc("packages.instances", "loop");
}
$tmpl->MxBloc("packages", "loop");
}
// output
$tmpl->MxWrite();
?>
|
|
From: <jhe...@us...> - 2002-11-12 13:52:05
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory usw-pr-cvs1:/tmp/cvs-serv30931
Modified Files:
uc_page.php
Log Message:
moved all group id from -1 to 1
Index: uc_page.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/lib/uc_page.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** uc_page.php 5 Aug 2002 08:35:02 -0000 1.2
--- uc_page.php 12 Nov 2002 13:51:59 -0000 1.3
***************
*** 42,45 ****
--- 42,46 ----
{
header("Location: " . $uc_info["objectRegistered"]);
+ exit();
}
}
***************
*** 49,54 ****
function open($forceLogin = false)
{
! global $username;
! global $password;
global $uc_info;
global $uc_lang;
--- 50,55 ----
function open($forceLogin = false)
{
! // global $username;
! // global $password;
global $uc_info;
global $uc_lang;
***************
*** 64,68 ****
// 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)
--- 65,69 ----
// 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)
***************
*** 74,78 ****
// Now, get user owning the session
$user = $this->session->getUser();
-
// get user's secondary groups gid
$userGroups = $user->groups;
--- 75,78 ----
***************
*** 84,87 ****
--- 84,88 ----
$uc_lang = $user->lang;
// is it an admin ?
+
if (in_array(0, $userGroups))
{
***************
*** 100,104 ****
// 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
--- 101,105 ----
// 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
|
|
From: <jhe...@us...> - 2002-11-12 11:11:28
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory usw-pr-cvs1:/tmp/cvs-serv29238
Added Files:
uc_utils.php
Log Message:
some utility functions
--- NEW FILE: uc_utils.php ---
<?php
function checkVar($varname, $default = null)
{
if (!empty($_GET[$varname]))
return $_GET[$varname];
else if (!empty($_POST[$varname]))
return $_POST[$varname];
else
return $default;
}
function checkVarIn($varname, $ar, $default = null)
{
if (!empty($_GET[$varname]) && in_array($_GET[$varname], $ar))
return $_GET[$varname];
else if (!empty($_POST[$varname]) && in_array($_POST[$varname]))
return $_POST[$varname];
else
return $default;
}
function download($src, $dest, $blkSize = 1024)
{
$from_fd = fopen($src, "rb");
$to_fd = fopen($dest, "wb");
$buffer = '';
$byteCount = 0;
while ($buffer = fread($from_fd, $blkSize))
{
$res = fwrite($to_fd, $buffer, $blkSize);
$byteCount += $res;
flush();
if ($res < 0)
{
$byteCount = -1;
break;
}
if ($res < $blkSize)
break;
}
fclose($from_fd);
fclose($to_fd);
return $blkSize;
}
function createDirectory($path)
{
$ar = explode("/", $path);
$p = "";
foreach ($ar as $a)
{
if (!empty($a))
{
$p .= "/" . $a;
if (file_exists($p))
{
if (!is_dir($p))
return false;
}
else
mkdir($p, 0777);
}
}
return true;
}
?>
|
|
From: <jhe...@us...> - 2002-11-12 11:10:04
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory usw-pr-cvs1:/tmp/cvs-serv28607
Modified Files:
uc_sql-mysql.inc
Log Message:
added requests for groups, sessions and packages handling
Index: uc_sql-mysql.inc
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/lib/uc_sql-mysql.inc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** uc_sql-mysql.inc 8 Aug 2002 13:54:39 -0000 1.4
--- uc_sql-mysql.inc 12 Nov 2002 11:10:01 -0000 1.5
***************
*** 10,13 ****
--- 10,16 ----
$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'"
+ . " AND $users_tbl.groupid = $groups_tbl.gid";
***************
*** 42,45 ****
--- 45,49 ----
$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'";
***************
*** 70,75 ****
--- 74,93 ----
$ucsql_sessionlogin = "UPDATE $session_tbl SET logged_in = 1, uid = '%s'"
. " WHERE sessid = '%s'";
+ $ucsql_sessionlogout = "UPDATE $session_tbl SET logged_in = 0, uid = NULL"
+ . " WHERE sessid = '%s'";
$ucsql_sessionsetip = "UPDATE $session_tbl SET ip = '%s'"
. " WHERE sessid = '%s'";
+ $ucsql_sessioncreate = "INSERT INTO $session_tbl (sessid) values ('%s')";
+ $ucsql_sessiondestroy = "DELETE FROM $session_tbl WHERE sessid='%s'";
+
+ // INSTALLER
+ $installer_tbl = $ucConfig->tblPrefix . $ucConfig->dbTables["installer"];
+ $ucsql_packagestatus = "SELECT * FROM $installer_tbl WHERE pkgname = '%s'";
+ $ucsql_packageregister = "INSERT INTO $installer_tbl"
+ . " (pkgname, pkgversion, pkgpath, tblprefix)"
+ . " VALUES ('%s', '%s', '%s', '%s')";
+ $ucsql_packageinstcomp = "UPDATE $installer_tbl SET installed = '1'"
+ . " WHERE pkgname = '%s' AND pkgversion = '%s'"
+ . " AND pkgpath = '%s' AND tblprefix = '%s'";
?>
|
|
From: <jhe...@us...> - 2002-11-12 11:08:31
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory usw-pr-cvs1:/tmp/cvs-serv27594
Modified Files:
uc_session.php
Log Message:
use of cookies and handling of anonymous user
Index: uc_session.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/lib/uc_session.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** uc_session.php 8 Aug 2002 10:08:06 -0000 1.3
--- uc_session.php 12 Nov 2002 11:08:29 -0000 1.4
***************
*** 3,8 ****
include_once("lib/uc_login.php");
! $SESSION_DATA = $ucConfig->tblPrefix . "session_data";
! include_once("lib/uc_session_handler.php");
--- 3,8 ----
include_once("lib/uc_login.php");
! //$SESSION_DATA = $ucConfig->tblPrefix . "session_data";
! //include_once("lib/uc_session_handler.php");
***************
*** 18,29 ****
function UcSession($returnPath)
{
! global $sessid;
! session_name("sessid");
session_start();
! $this->sessid = $sessid;
$this->db = new UcSql();
$this->returnPath = $returnPath;
// check the IP
$this->checkIp();
--- 18,48 ----
function UcSession($returnPath)
{
! global $ucsql_sessioncreate;
! global $ucsql_sessionget;
! global $ucsid;
!
! $this->name = "ucsid";
! session_name($this->name);
session_start();
!
! $this->sessid = $ucsid;
!
!
$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
+ $query = sprintf($ucsql_sessioncreate, $this->sessid);
+ $this->db->Execute($query)
+ or die("Unable to add session to database: "
+ . $this->db->ErrorMsg());
+ }
+
// check the IP
$this->checkIp();
***************
*** 32,37 ****
function destroy()
{
! session_destroy();
! header("Location: " . $wwwroot);
}
--- 51,59 ----
function destroy()
{
! global $ucsql_sessiondestroy;
!
! $query = sprintf($ucsql_sessiondestroy, $this->sessid);
! $this->db->Execute($query) or die("Unable to destroy session: "
! . $this->db->ErrorMsg());
}
***************
*** 76,133 ****
}
! function getUser()
{
global $username;
global $password;
- global $ucsql_sessionget;
global $uc_info;
! // retrieve the uid associated with this session from the db
! $query = sprintf($ucsql_sessionget, $this->sessid);
! $res = $this->db->Execute($query) or
! die("Unable to get session info: " . $this->db->ErrorMsg());
! $o = $res->FetchNextObject(true);
!
! if ($o->UID)
{
! // user has already authentified for the session
! $this->user = getUser('', $o->UID);
}
else
{
! // user has not yet authentified for the session
! if (isset($username) && isset($password))
! {
! // we have the password/login
! if ($this->checkPassword($username, $password))
! {
! // good, update session with user
! $user = getUser($username, '');
! $this->setUser($user);
! }
! else
! {
! // bad, redirect to some message
! header("Location: " . $uc_info["badLoginMsg"]);
! }
! }
! else
! {
! // we don't have password/login, ask for it
! uc_login($this->returnPath);
! exit();
! }
}
-
- return $this->user;
}
! function setUser($user)
{
! global $ucsql_sessionlogin;
! $this->user = $user;
! $query = sprintf($ucsql_sessionlogin, $this->user->uid, $this->sessid);
! $res = $this->db->Execute($query) or
! die("Unable to set session uid: " . $this->db->ErrorMsg());
}
--- 98,173 ----
}
!
! function login($username, $password)
{
global $username;
global $password;
global $uc_info;
+ global $ucsql_sessionlogin;
! // we have the password/login
! if ($this->checkPassword($username, $password))
{
! // good, update session with user
! $this->user = getUser($username, '');
! $query = sprintf($ucsql_sessionlogin,
! $this->user->uid,
! $this->sessid);
! $res = $this->db->Execute($query) or
! die("Unable to set session uid: "
! . $this->db->ErrorMsg());
}
else
{
! // bad, redirect to some message
! header("Location: " . $uc_info["badLoginMsg"]
! . "?ret=" . $this->returnPath);
}
}
! function logout()
{
! global $ucsql_sessionlogout;
! $query = sprintf($ucsql_sessionlogout, $this->sessid);
! $this->db->Execute($query)
! or die("UPCASE: Unable to logout the session: "
! . $this->db->ErrorMsg());
!
! session_unset();
! session_destroy();
! $ar = session_get_cookie_params();
! setcookie($this->name, "", time() - 3600, $ar["path"],
! $ar["domain"], $ar["secure"]);
!
! $this->destroy();
! }
!
!
! function getUser()
! {
! global $ucConfig;
! global $ucsql_sessionget;
! $query = sprintf($ucsql_sessionget, $this->sessid);
! $res = $this->db->Execute($query) or die("Unable to get session: " .
! $this->db->ErrorMsg());
! if ($res->RowCount() == 1)
! {
! $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;
}
***************
*** 137,141 ****
$query = sprintf($ucsql_usercheckpw, $username, $password);
$res = $this->db->Execute($query) or
! die("Error while checking password: " . $this->db->ErrorMsg());
if ($res->RowCount() != 1)
{
--- 177,181 ----
$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)
{
|
|
From: <jhe...@us...> - 2002-11-12 11:06:19
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory usw-pr-cvs1:/tmp/cvs-serv26230
Added Files:
uc_repository.php
Log Message:
client side repository handling (info retrieval and updating)
--- NEW FILE: uc_repository.php ---
<?php
define("REPOSITORY_ROOT", "/packages");
define("METADATA_FILE", "meta.inc");
define("METADATA_BACKUP", "/db");
include_once("uc_utils.php");
class UcRepositoryObject
{
var $sourceDir; // remote directory for this object
var $localDir; // local directory where this objects live
var $metaDataFile;
var $name;
function UcRepositoryObject($localDir, $sourceDir)
{
$this->localDir = $localDir;
$this->metaDataFile = $this->localDir . "/" . METADATA_FILE;
$this->sourceDir = $sourceDir;
}
function initialize()
{
}
function fetchMetaData()
{
$srcFile = $this->sourceDir . "/" . METADATA_FILE;
$dstFile = $this->metaDataFile;
if (file_exists($dstFile))
unlink($dstFile);
if (download($srcFile, $dstFile) > -1)
return true;
else
return false;
}
function checkDirectory()
{
if (is_dir($this->localDir) && is_writeable($this->localDir))
return true;
return false;
}
function createDirectory()
{
if (file_exists($this->localDir))
{
if (!is_dir($this->localDir))
die("$this->localDir exists and is not a directory");
}
else
mkdir($this->localDir, 0775)
or die("Unable to create directory $this->localDir");
}
function update()
{
$this->fetchMetaData() or
die("Unable to get meta data for $this->name");
$this->initialize();
}
}
class UcLocalRepository extends UcRepositoryObject
{
var $categories;
var $description;
var $metaBackup;
function UcLocalRepository()
{
$cfg = $GLOBALS["ucConfig"];
$this->UcRepositoryObject($cfg->filesRoot . REPOSITORY_ROOT,
$GLOBALS["packagesSource"]);
$this->name = "repository";
$this->initialize();
}
function initialize()
{
if (!$this->checkDirectory())
$this->createDirectory();
if (!file_exists($this->metaDataFile))
$this->fetchMetaData();
include($this->metaDataFile);
foreach ($categories as $categoryName)
{
$this->categories[] = $categoryName;
}
$this->categories = $categories;
$this->description = $description;
}
function getCategories()
{
$car = array();
foreach ($this->categories as $category)
$car[$category] = new UcCategory($this, $category);
return $car;
}
function getCategory($category)
{
$car = $this->getCategories();
return $car[$category];
}
function update()
{
$this->fetchMetaData() or
die("Unable to get meta data for $this->name");
$this->initialize();
$categories = $this->getCategories();
foreach ($categories as $category)
$category->update();
}
}
class UcCategory extends UcRepositoryObject
{
var $packages;
var $description;
function UcCategory($repository, $categoryName)
{
$this->UcRepositoryObject($repository->localDir . "/$categoryName",
$repository->sourceDir . "/$categoryName");
$this->name = $categoryName;
$this->initialize();
}
function initialize()
{
if (!$this->checkDirectory())
$this->createDirectory();
if (!file_exists($this->metaDataFile))
$this->fetchMetaData();
include($this->metaDataFile);
$this->packages = $packages;
$this->description = $description;
}
function getPackages()
{
$par = array();
foreach ($this->packages as $packageName)
$par[$packageName] = new UcPackage($this, $packageName);
return $par;
}
function getPackage($pkgname)
{
$par = $this->getPackages();
return $par[$pkgname];
}
function update()
{
$this->fetchMetaData() or
die("Unable to get meta data for $this->name");
$this->initialize();
$packages = $this->getPackages();
foreach ($packages as $package)
$package->update();
}
}
class UcPackage extends UcRepositoryObject
{
function UcPackage($category, $packageName)
{
$this->UcRepositoryObject($category->localDir . "/$packageName",
$category->sourceDir . "/$packageName");
$this->name = $packageName;
$this->initialize();
}
function initialize()
{
if (!$this->checkDirectory())
$this->createDirectory();
if (!file_exists($this->metaDataFile))
$this->fetchMetaData();
include($this->metaDataFile);
$this->description = $description;
$this->homePage = $home_page;
$this->version = $version;
$this->source = $source;
}
}
?>
|
|
From: <jhe...@us...> - 2002-11-12 11:02:04
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory usw-pr-cvs1:/tmp/cvs-serv23909
Modified Files:
uc_login.php
Log Message:
added logout
Index: uc_login.php
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/lib/uc_login.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** uc_login.php 5 Aug 2002 08:27:44 -0000 1.2
--- uc_login.php 12 Nov 2002 11:02:01 -0000 1.3
***************
*** 15,18 ****
--- 15,24 ----
}
+ function uc_logout()
+ {
+ session_unset();
+ session_destroy();
+ }
+
?>
|
|
From: <jhe...@us...> - 2002-11-12 11:01:03
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory usw-pr-cvs1:/tmp/cvs-serv23071
Added Files:
uc_installer.php
Log Message:
First package installer class
--- NEW FILE: uc_installer.php ---
<?php
include_once("lib/uc_sql.php");
include_once("lib/uc_utils.php");
include_once("lib/Tar.php");
define("MYSQL_QUERIES", "/upcase/mysql.inc");
define("PACKAGE_SETUP", "/upcase/setup.inc");
define("PACKAGE_NOT_INSTALLED", 0);
define("PACKAGE_FULLY_INSTALLED", 1);
define("PACKAGE_PARTIALY_INSTALLED", -1);
class UcPackageDBInfo
{
var $name;
var $host;
var $user;
var $passwd;
var $prefix;
}
class UcInstaller
{
var $metaBackup;
var $db;
function UcInstaller()
{
$cfg = $GLOBALS["ucConfig"];
$this->metaBackup = $cfg->filesRoot . "/packages/db";
$this->db = new UcSql();
$this->tmpDir = $cfg->filesRoot . "/packages/dl";
}
// Return an array of
// [pkgversion, pkgurl, pkgstatus]
function getStatus($package)
{
$query = sprintf($GLOBALS["ucsql_packagestatus"], $package->name);
$res = $this->db->Execute($query)
or die("Unable to look up package: " . $this->db->ErrorMsg()
. "QUERY: " . $query);
if ($res->RowCount() == 0)
return array();
else if ($res->RowCount() > 0)
{
$ar = array();
while ($o = $res->FetchNextObject(true))
{
$pkg = array();
$pkg["version"] = $o->PKGVERSION;
$pkg["url"] = $o->PKGPATH;
if ($o->INSTALLED == 1)
$pkg["status"] = PACKAGE_FULLY_INSTALLED;
$ar[] = $pkg;
}
return $ar;
}
else
die("Error while counting: " . $this->db->ErrorMsg());
}
function saveMetaData($package)
{
$srcFile = $package->metaDataFile;
$dstFile = $this->metaBackup . "/" . $package->name
. "-" . $package->version . ".inc";
if (!file_exists($dstFile))
copy($srcFile, $dstFile);
}
function download($package)
{
print("Downloading<br>");
$res = download($package->sourceDir . "/" . $package->source,
$this->tmpDir . "/" . $package->source);
if ($res < 0)
return false;
return true;
}
// Check if a path does not contains '..' and symlinks
// Used to check the validity of the module URL given
// to the package installer.
function checkPathValidity($absolutePath)
{
// Absolute path ?
if (preg_match("/^\//", $absolutePath) < 1)
return false;
// Path contains .. ?
if (preg_match("/\.\./", $absolutePath) > 0)
return false;
// Check for symlinks
$ar = explode("/", $absolutePath);
$newPath = "";
foreach ($ar as $a)
{
if (!empty($a))
{
$newPath .= "/" . $a;
if (!file_exists($newPath))
break;
if (is_link($newPath))
return false;
}
}
return true;
}
function unpack($package, $path)
{
print("$path<br>");
$archive = new Archive_Tar($this->tmpDir
. "/" . $package->source, true);
return $archive->extractModify($path, $package->name . "-"
. $package->version
. "-uc");
}
function setupMySQL($package, $path, $tblPrefix)
{
$tblprefix = $tblPrefix . "_";
include($path . MYSQL_QUERIES);
foreach($queries as $query)
{
$this->db->Execute($query)
or die("Unable to execute query: " . $query . "<br>\n"
. "Error: " . $this->db->ErrorMsg());
}
return true;
}
function setupPackage($package, $path, $tblPrefix)
{
$cfg = $GLOBALS["ucConfig"];
$dbinf = new UcPackageDBInfo();
$dbinf->name = $cfg->dbName;
$dbinf->user = $cfg->dbUser;
$dbinf->passwd = $cfg->dbPasswd;
$dbinf->host = $cfg->dbHost;
$dbinf->prefix = $tblPrefix . "_";
include_once($path . PACKAGE_SETUP);
setup($dbinf, $cfg->wwwModules . "/" . basename($path),
$path)
or die("Unable to setup package");
return true;
}
function registerPackage($package, $path, $tblPrefix)
{
$query = sprintf($GLOBALS["ucsql_packageregister"],
$package->name, $package->version,
$path, $tblPrefix);
$this->db->Execute($query)
or die("Unable to register package: " . $this->db->ErrorMsg());
return true;
}
function setInstallComplete($package, $path, $tblPrefix)
{
$query = sprintf($GLOBALS["ucsql_packageinstcomp"],
$package->name, $package->version,
$path, $tblPrefix);
print("$query<br>");
$this->db->Execute($query)
or die("Unable to flag package as installed: " .
$this->db->ErrorMsg());
}
function install($package, $pkgRelUrl, $tblPrefix)
{
$cfg = $GLOBALS["ucConfig"];
$pkgPath = $cfg->modulesRoot . "/" . $pkgRelUrl;
$this->download($package)
or die("Unable to get package archive");
$this->checkPathValidity($pkgPath)
or die("Invalid URL");
$this->registerPackage($package, $pkgRelUrl, $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");
$this->setupMySQL($package, $pkgPath, $tblPrefix)
or die("Unable to set up MySQL");
$this->setupPackage($package, $pkgPath, $tblPrefix)
or die("Unable to set up package");
$this->setInstallComplete($package, $pkgRelUrl, $tblPrefix);
}
function uninstall()
{
}
}
?>
|
|
From: <jhe...@us...> - 2002-08-08 13:56:36
|
Update of /cvsroot/upcase-project/UpCase/packages In directory usw-pr-cvs1:/tmp/cvs-serv3518 Removed Files: packages.xml uc_packages.php Log Message: Nothing to do here ... --- packages.xml DELETED --- --- uc_packages.php DELETED --- |
|
From: <jhe...@us...> - 2002-08-08 13:54:42
|
Update of /cvsroot/upcase-project/UpCase/lib
In directory usw-pr-cvs1:/tmp/cvs-serv2849
Modified Files:
uc_sql-mysql.inc
Log Message:
fixed typo
Index: uc_sql-mysql.inc
===================================================================
RCS file: /cvsroot/upcase-project/UpCase/lib/uc_sql-mysql.inc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** uc_sql-mysql.inc 8 Aug 2002 12:03:39 -0000 1.3
--- uc_sql-mysql.inc 8 Aug 2002 13:54:39 -0000 1.4
***************
*** 38,42 ****
. " SET lastname='%s' WHERE uid='%s'";
$ucsql_useremail = "UPDATE $users_tbl"
! . "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'";
--- 38,43 ----
. " SET lastname='%s' WHERE uid='%s'";
$ucsql_useremail = "UPDATE $users_tbl"
! . " 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'";
|
|
From: <jhe...@us...> - 2002-08-08 13:53:40
|
Update of /cvsroot/upcase-project/UpCase/lib In directory usw-pr-cvs1:/tmp/cvs-serv2412 Added Files: Tar.php Log Message: server-side handling of tarballs --- NEW FILE: Tar.php --- <?php /* vim: set ts=4 sw=4: */ // +----------------------------------------------------------------------+ // | PHP version 4.0 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2001 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | li...@ph... so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Vincent Blavet <vi...@bl...> | // +----------------------------------------------------------------------+ // // $Id: Tar.php,v 1.1 2002/08/08 13:53:37 jherfurth Exp $ [...1006 lines suppressed...] // Should be the first $i=0, but no check is done } else if ($v_list[$i] == "..") { // ----- Ignore it and ignore the $i-1 $i--; } else if (($v_list[$i] == "") && ($i!=(sizeof($v_list)-1)) && ($i!=0)) { // ----- Ignore only the double '//' in path, // but not the first and last '/' } else { $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:""); } } } return $v_result; } // }}} } ?> |