[Openfirst-cvscommit] members default.html,NONE,1.1 web.php,NONE,1.1 workspace.php,1.5,1.6
Brought to you by:
xtimg
From: <xt...@us...> - 2003-08-12 19:59:25
|
Update of /cvsroot/openfirst/members In directory sc8-pr-cvs1:/tmp/cvs-serv10180 Modified Files: workspace.php Added Files: default.html web.php Log Message: Add preliminary personal workspace ability to members area (only supports text/html at this point in time), fix bug with virtfs creation. --- NEW FILE: default.html --- <html> <head> <title>Default Page</title> </head> <body> <h1>Default Page</h1> <p>Hello, I haven't yet modified my personal web page. Feel free to contact me, my information is listed elsewhere on the site.</p> <h2>Seeing this page instead of the page you expected?</h2> <p>This page is the default page created by the <a href="http://www.openfirst.org/">open FIRST Web Portal System</a> for user accounts. Users are supposed to replace this page with their own content. <a href="http://www.openfirst.org/">open FIRST</a> is not affiliated with this person, and is not responsible for the content on this web site.</p> </body> </html> --- NEW FILE: web.php --- <?php /* * openFIRST.members - web.php * * Copyright (C) 2003, * openFIRST Project * Original Author: Tim Ginn <tim...@po...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ include("../config/globals.php"); echo("<p><strong>Disclaimer:</strong> This page is not maintained by the administration of the rest of the site. The opinions and views expressed here are those of the author and are not necessarily the views and opinions of the administration.</p>"); $user = substr($_GET["uri"],1, strpos($_GET["uri"], "/", 2) - 1); $file = substr($_GET["uri"],strlen($user) + 2, strlen($_GET["uri"]) - strlen($user)); $vfs = mysql_fetch_object(mysql_query("SELECT virtfspath FROM ofirst_workspace_users WHERE user='$user';")); $vfs = $vfs->virtfspath . "www/"; if(substr($file, -1, 1) == "/") { $file .= "index.html"; } if($file == "") { $file .= "index.html"; } if ($fd = fopen ($vfs . $file, "rb")) { fpassthru($fd); } ?> Index: workspace.php =================================================================== RCS file: /cvsroot/openfirst/members/workspace.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** workspace.php 12 Aug 2003 04:27:00 -0000 1.5 --- workspace.php 12 Aug 2003 17:09:14 -0000 1.6 *************** *** 435,441 **** } else { if($_GET["activate"] == true) { ! if(iswritable(getcwd() . "/virtfs/") == true) { mysql_query("INSERT INTO ofirst_workspace_users (quota, user, virtfspath, frozen) VALUES('10', '$user->user', '" . getcwd() . "/virtfs/$user->user/', '0');"); mkdir(getcwd() . "/virtfs/$user->user/"); echo("Congratulations, your workspace has been created. [ <a href='workspace.php'>Continue</a> ]"); } else { --- 435,452 ---- } else { if($_GET["activate"] == true) { ! if(is_writable(getcwd() . "/virtfs/") == true) { mysql_query("INSERT INTO ofirst_workspace_users (quota, user, virtfspath, frozen) VALUES('10', '$user->user', '" . getcwd() . "/virtfs/$user->user/', '0');"); mkdir(getcwd() . "/virtfs/$user->user/"); + mkdir(getcwd() . "/virtfs/$user->user/www/"); + mkdir(getcwd() . "/virtfs/$user->user/$filepath/" . $_POST["directory"]); + $uf = mysql_query("INSERT INTO ofirst_workspace_files (size, location, owner, permissions, + date, description, filetype, name) VALUES('0', '$filepath', '$user->user', 'drw-------', '" . + date('D M d Y h:m:s') . "', 'Web Site Directory', 'dir-folder_html.png', 'www');"); + + $uf = mysql_query("INSERT INTO ofirst_workspace_files (size, location, owner, permissions, + date, description, filetype, name) VALUES('0', '/www', '$user->user', '-rw-------', '" . + date('D M d Y h:m:s') . "', 'Main Page for Personal Web Site', 'html', 'index.html');"); + copy("default.html", getcwd() . "/virtfs/$user->user/www/index.html"); + echo("Congratulations, your workspace has been created. [ <a href='workspace.php'>Continue</a> ]"); } else { |