From dd24e2c973a7979894971bdc38d904d2aecc7d5d Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Thu, 12 May 2011 16:59:36 -0700 Subject: Well, you can see posts on the moderation panel now --- htdocs/moderate/src/accounts.inc.php | 67 ++++++++++++++++++++++++++++++++++++ htdocs/moderate/src/footer.inc.php | 6 ++++ htdocs/moderate/src/header.inc.php | 64 ++++++++++++++++++++++++++++++++++ 3 files changed, 137 insertions(+) create mode 100644 htdocs/moderate/src/accounts.inc.php create mode 100644 htdocs/moderate/src/footer.inc.php create mode 100644 htdocs/moderate/src/header.inc.php (limited to 'htdocs/moderate/src') diff --git a/htdocs/moderate/src/accounts.inc.php b/htdocs/moderate/src/accounts.inc.php new file mode 100644 index 0000000..fac6c7c --- /dev/null +++ b/htdocs/moderate/src/accounts.inc.php @@ -0,0 +1,67 @@ +fetchAssocRow($query); + + } catch (Cif_Database_Exception $e) { + $results = false; + } + + return $results; +} + +function updatePassword($id, $password) { + $db = getDatabase(); + + $row['password'] = sha1($password); + + $db->update('jpm_users', $row, "WHERE `id`='$id'"); +} + +function getAccounts($s) { + $query = "SELECT * FROM jpm_users"; + + if (!is_null($s)) { + $s = addslashes($s); + $query .= " WHERE name LIKE '%$s%' OR email LIKE '%$s%'"; + } + + $query .= " ORDER BY name"; + + $db = getDatabase(); + + $results = array(); + + try { + $results = $db->fetchAssocRows($query); + + } catch (Cif_Database_Exception $e) { + $results = array(); + } + + return $results; +} + +function generatePassword() { + $alphabet = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz123456789!@#$%*()"; + $length = strlen($alphabet); + + $password = ''; + for ($i = 0; $i < 8; $i++) { + $pos = rand(0, $length - 1); + $password .= substr($alphabet, $pos, 1); + } + + return $password; +} + +?> diff --git a/htdocs/moderate/src/footer.inc.php b/htdocs/moderate/src/footer.inc.php new file mode 100644 index 0000000..96d3e78 --- /dev/null +++ b/htdocs/moderate/src/footer.inc.php @@ -0,0 +1,6 @@ + + + + + + diff --git a/htdocs/moderate/src/header.inc.php b/htdocs/moderate/src/header.inc.php new file mode 100644 index 0000000..4310009 --- /dev/null +++ b/htdocs/moderate/src/header.inc.php @@ -0,0 +1,64 @@ +fetchAssocRow($query); + + if ($result) { + $SESSION['currentUser'] = $result; + } + + } +} + +?> + + + + + + + + + + +

Foursquare Admin Panel

+ + +
-- cgit v1.2.3