From 61ab452496b1117f23f2c198d9b313c495939a26 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 26 Oct 2010 19:30:27 +1030 Subject: [PATCH 1/1] web: clean up directory --- web/approval.php | 134 ----------------------------------------- web/changedetail.php | 107 -------------------------------- web/configuration | 43 ------------- web/dbfunc | 11 ---- web/del.php | 43 ------------- web/dispmoduleinfo.php | 57 ------------------ web/functions.php | 42 ------------- web/index.php | 40 ------------ web/login.php | 105 -------------------------------- web/logout.php | 13 ---- web/main.html | 46 -------------- web/requestid.php | 95 ----------------------------- web/search.php | 48 --------------- web/searchengine.php | 20 ------ 14 files changed, 804 deletions(-) delete mode 100644 web/approval.php delete mode 100644 web/changedetail.php delete mode 100644 web/configuration delete mode 100644 web/dbfunc delete mode 100644 web/del.php delete mode 100644 web/dispmoduleinfo.php delete mode 100644 web/functions.php delete mode 100644 web/index.php delete mode 100644 web/login.php delete mode 100644 web/logout.php delete mode 100644 web/main.html delete mode 100644 web/requestid.php delete mode 100644 web/search.php delete mode 100644 web/searchengine.php diff --git a/web/approval.php b/web/approval.php deleted file mode 100644 index dc99ca7d..00000000 --- a/web/approval.php +++ /dev/null @@ -1,134 +0,0 @@ -You donot have a rite to approve users"; - exit(); - } - - //extracting user information - $query = "SELECT * FROM users where username=\"$accountid\""; - $result = sqlite3_query($handle, $query) or die("Error in query: ".sqlite3_error($handle)); - if (($row = sqlite3_fetch_array($result)) == '') { - echo "
Not a valid account id
"; - exit(); - } - - $name = $row["name"]; - $email = $row["email"]; - $website = $row["website"]; - $desc = $row["description"]; - - if($row["approved"] == "true") { - $query = "SELECT * FROM approval where approved=\"$accountid\""; - $result = sqlite3_query($handle, $query) or die("Error in query: ".sqlite3_error($handle)); - $row = sqlite3_fetch_array($result); - echo "
Already $accountid is approved by ".$row["approvedby"]."...
"; - exit(); - } -?> -

Approval

-
- - - - - - - - - - - - - - - - - - - - - - - -

Full name:

Account id:

Email:

-

Description:

Web Site:

Admin rites (check this if you want this user to be admin)
-

- - - Successfully approved $accountid..."; -} - -//if approval is canceled -else if (isset($_POST['cancel'])) { -//delete user -$handle = sqlite3_open($db) or die("Could not open database"); -$query = "delete from users where username=\"$accountid\""; -$result = sqlite3_exec($handle, $query) or die("Error in query: ".sqlite3_error($handle)); -echo "
Successfully cancelled $accountid...
"; -} - -function generate_passwd($length = 16) { - static $chars = '!@#$%^&*abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ23456789'; - $chars_len = strlen($chars); - for ($i = 0; $i < $length; $i++) - $password .= $chars[mt_rand(0, $chars_len - 1)]; - return $password; -} -?> \ No newline at end of file diff --git a/web/changedetail.php b/web/changedetail.php deleted file mode 100644 index 0915d26d..00000000 --- a/web/changedetail.php +++ /dev/null @@ -1,107 +0,0 @@ - 16) - $errmsg = 'Password should have length between 6 and 16'; - if($password != $repassword) - $errmsg = 'Password and retype password not match'; - } -} - -if(trim($errmsg) != '' || !isset($_POST['submit'])) { -?> -

Change CCAN account

-
-
Note: Please leave password fields blank if you donot want to change
-
- - - - - - - - - - - - - - - - - - -

Full name:

Email:

New Password:

Retype Password:


-

Web Site[Optional]:


-
-
-
- - - Sucessfully changed ".$ispass."... "; -} - -function isEmail($email) -{ - return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i" - ,$email)); -} -?> diff --git a/web/configuration b/web/configuration deleted file mode 100644 index aeeca274..00000000 --- a/web/configuration +++ /dev/null @@ -1,43 +0,0 @@ - diff --git a/web/dbfunc b/web/dbfunc deleted file mode 100644 index 99b33ea6..00000000 --- a/web/dbfunc +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/web/del.php b/web/del.php deleted file mode 100644 index f494f223..00000000 --- a/web/del.php +++ /dev/null @@ -1,43 +0,0 @@ - diff --git a/web/dispmoduleinfo.php b/web/dispmoduleinfo.php deleted file mode 100644 index 3906d3cc..00000000 --- a/web/dispmoduleinfo.php +++ /dev/null @@ -1,57 +0,0 @@ - - - - - -
- Download'; - ?> - - Download Dependencies'; - ?> -
- - - - - - - - - - - - - - - - - - - - -

Module:

Title:

 

Author:

>

Dependencies:

Description:


- -" . $msg . "Contact ccan admin. "; - exit(); - } -} -?> diff --git a/web/functions.php b/web/functions.php deleted file mode 100644 index 4b89fa5a..00000000 --- a/web/functions.php +++ /dev/null @@ -1,42 +0,0 @@ -read()) { - // Skip pointers - if ($entry == '.' || $entry == '..') { - continue; - } - - // Recurse - rmdirr($dirname . DIRECTORY_SEPARATOR . $entry); - } - - // Clean up - $dir->close(); - return rmdir($dirname); -} - -function getccanadmin($db) -{ - //forming admin mail addresses from data base - $handle = sqlite3_open($db) or die("Could not open database"); - $query = "SELECT email FROM users where admin=\"true\""; - $result = sqlite3_query($handle, $query) or die("Error in query: ".sqlite3_error($handle)); - - while ($row = sqlite3_fetch_array($result)) - $admin = $admin.$row['email'].","; - return $admin; -} -?> diff --git a/web/index.php b/web/index.php deleted file mode 100644 index 20f400c5..00000000 --- a/web/index.php +++ /dev/null @@ -1,40 +0,0 @@ -Please enter some keyword to search'; - exit(); - } -} -else if($_GET['author'] != '') { - $searchtext = $_GET['author']; - $in = "author"; -} -else if ($_GET['disp'] == 'all') { - $searchtext = ""; - $in = "module"; -} -else - exit(); - -$result = searchdb($searchtext, $in, $db); -echo ''; -if($row = sqlite3_fetch_array($result)) - echo ""; -else - echo '
No results found
'; -while($row = sqlite3_fetch_array($result)) { - echo ""; -} -echo '
".$row["module"]."
". - "".$row["author"]." : ". $row["title"]."

".$row["module"]."
". - "".$row["author"]." : ". $row["title"]."

'; -?> diff --git a/web/login.php b/web/login.php deleted file mode 100644 index 90488f91..00000000 --- a/web/login.php +++ /dev/null @@ -1,105 +0,0 @@ -
Already logged in as ".$_SESSION['susername']."...
"; - exit(); -} - -if(!isset($_POST['submit'])) { - include('logo.html'); - include('menulist.html'); - loginhtml("Members only. Please login to access."); - exit(); -} - -// get username and password -$username = $_POST['username']; -$password = $_POST['password']; - -// register username and logged as session variables. -session_register("susername"); -session_register("slogged"); - -//set session variables -$_SESSION["susername"] = $username; -$_SESSION["slogged"] = false; - -// open database file -$handle = sqlite3_open($db) or die("Could not open database"); -// query string -$query = "SELECT * FROM login where username=\"$username\""; -// execute query -$result = sqlite3_query($handle, $query) or die("Error in query: ".sqlite3_error($handle)); -// if rows exist -if (($row = sqlite3_fetch_array($result)) != '') { - if(md5($password) == $row["password"]) - $valid_user = 1; -} -else { -$valid_user = 0; -} - -//if not valid user -if (!($valid_user)) { - // Unset session variables. - session_unset(); - include('logo.html'); - include('menulist.html'); - loginhtml("Incorrect login information, please try again. You must login to access."); - exit(); -} - -//if valid user -else { - $referer = $_GET['referer']; - $_SESSION["slogged"] = true; - if($referer != '') { - header('Location: '.$referer); - exit(); - } - include('logo.html'); - include('menulist.html'); - echo "
Logged in sucessfully..."; -} - - - -function loginhtml($info) -{ -?> -
" method="POST"> -

- - - - - - - - - - - - -
-Username: - - -
-Password: - - -
- - -

- - - - diff --git a/web/logout.php b/web/logout.php deleted file mode 100644 index ef6a9d7f..00000000 --- a/web/logout.php +++ /dev/null @@ -1,13 +0,0 @@ -
Logged out Successfully...
"; -else - echo "
Please login...
"; - -session_destroy(); -?> \ No newline at end of file diff --git a/web/main.html b/web/main.html deleted file mode 100644 index 773e3a13..00000000 --- a/web/main.html +++ /dev/null @@ -1,46 +0,0 @@ -

CCAN provides two kinds of useful C -code: junkcode is a -collection of uploaded code with no particular order, and - -CCAN modules are more structured, -with documentation, dependencies and testcases. - -

- -

Using The Code

- -

- -You can search, browse summary pages for all the modules or use the -Bazaar repository -at http://ccan.ozlabs.org/repo. - -

- -

Contributing Code

- -

-You can upload a .tar.gz, .tar.bz, .tar or .zip -containing C code; if you have not created an account this won't be -visible until the contents have been checked by a human. -

- -

"GPLv2 or later" and supersets thereof (eg. LGPLv2+ or BSD) -licenses preferred. -

- -

Questions?

- -

-We have a low volume -mailing list for discussion of CCAN in general, and you're welcome -to join. -

- -

-We also have an IRC channel: #ccan on Freenode. -

- -

-We also have a wiki; feel free to enhance it. -

diff --git a/web/requestid.php b/web/requestid.php deleted file mode 100644 index 3d293ddd..00000000 --- a/web/requestid.php +++ /dev/null @@ -1,95 +0,0 @@ - 16) { - $errmsg = 'account id should have length between 4 and 16'; - } - else if(trim($accountid) != '') { - $handle = sqlite3_open($db) or die("Could not open database"); - $query = "SELECT * FROM users where username=\"$accountid\""; - $result = sqlite3_query($handle, $query) or die("Error in query: ".sqlite3_error($handle)); - - if (($row = sqlite3_fetch_array($result)) != '') { - $errmsg = 'Desired id already exist. Please enter different Desired id.'; - } - } - else if(trim($description) == '') { - $errmsg = 'Please enter your description'; - } - else if(strlen($description) < 20) { - $errmsg = 'Description should atleast be 20 characters'; - } -} - -if(trim($errmsg) != '' || !isset($_POST['submit'])) { -?> -

Request CCAN account

-
-
- - - - - - - - - - - - - - - - - - - -

Full name:

Email:


Desired ID:


Web Site[Optional]:


A short description of what you are planning to contribute:

-

-
-

- -
Thank you for registering with CCAN. You will get the password to your mail after approval.
- diff --git a/web/search.php b/web/search.php deleted file mode 100644 index d518d9f4..00000000 --- a/web/search.php +++ /dev/null @@ -1,48 +0,0 @@ -Please enter some keyword to search
'; - exit(); - } - $searchtext = '%'.$searchtext.'%'; -} -else if($_GET['author'] != '') { - $searchtext = '%'.$_GET['author'].'%'; - $in = "author"; -} -else if ($_GET['disp'] == 'all') { - $searchtext = "%"; - $in = "module"; -} -else if ($_GET['disp'] != '') { - $searchtext = $_GET['disp'].'%'; - $in = "module"; -} - -else - exit(); - -$result = searchdb($searchtext, $in, $db); -echo ''; -if($row = sqlite3_fetch_array($result)) - echo ""; -else - echo '
No results found
'; -while($row = sqlite3_fetch_array($result)) { - echo ""; -} -echo '
".$row["module"]."
". - "".$row["author"]." : ". $row["title"]. - "

".$row["module"]."
". - "".$row["author"]." : ". $row["title"]. - "

'; -?> diff --git a/web/searchengine.php b/web/searchengine.php deleted file mode 100644 index fdc5e9f8..00000000 --- a/web/searchengine.php +++ /dev/null @@ -1,20 +0,0 @@ - \ No newline at end of file -- 2.39.2