From 1a7fa60f6cb2ee26843ca19e37bb4ff44104ad55 Mon Sep 17 00:00:00 2001 From: Bulletin Date: Thu, 29 Dec 2016 16:42:32 -0500 Subject: Added existing progress --- inc/common.php | 9 ++++++++ inc/config.php | 18 +++++++++++++++ inc/db.php | 10 +++++++++ inc/eml.tpl | 23 +++++++++++++++++++ inc/fatal.tpl | 23 +++++++++++++++++++ inc/forgot.tpl | 23 +++++++++++++++++++ inc/functions.php | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ inc/mobile.php | 9 ++++++++ inc/user.php | 18 +++++++++++++++ 9 files changed, 200 insertions(+) create mode 100644 inc/common.php create mode 100644 inc/config.php create mode 100644 inc/db.php create mode 100644 inc/eml.tpl create mode 100644 inc/fatal.tpl create mode 100644 inc/forgot.tpl create mode 100644 inc/functions.php create mode 100644 inc/mobile.php create mode 100644 inc/user.php (limited to 'inc') diff --git a/inc/common.php b/inc/common.php new file mode 100644 index 0000000..ac55bde --- /dev/null +++ b/inc/common.php @@ -0,0 +1,9 @@ + diff --git a/inc/config.php b/inc/config.php new file mode 100644 index 0000000..93050e7 --- /dev/null +++ b/inc/config.php @@ -0,0 +1,18 @@ + 'https://www.bulletinalpha.tk/', + 'c_name' => 'bulletin', + 'c_expire' => 31536000, + 'c_dom' => '.bulletinalpha.tk', + 'c_path' => '/', + 'c_sec' => true, + 'c_http' => true, + 'db_host' => 'localhost', + 'db_name' => 'bulletin', + 'db_user' => 'bulletin', + 'db_pass' => 'chV`tX8B_:e4/><}$(KO2)dE:~:O1)r@', + 'mail_from' => 'Bulletin ', + 'mobile_base' => 'https://m.bulletinalpha.tk/', + 'moblie_host' => 'm.bulletinalpha.tk', +); +?> diff --git a/inc/db.php b/inc/db.php new file mode 100644 index 0000000..bb4b9f7 --- /dev/null +++ b/inc/db.php @@ -0,0 +1,10 @@ + diff --git a/inc/eml.tpl b/inc/eml.tpl new file mode 100644 index 0000000..e09831d --- /dev/null +++ b/inc/eml.tpl @@ -0,0 +1,23 @@ + + + + + Active Your Bulletin Account + + + +
+
+

Congratulations on creating your Bulletin account! We hope we can help you to find as many useful work connections as possible.

+

To activate your account, click here.

+
+
+
+

Welcome to Bulletin!

+

Copyright © 2016 Bulletin Team

+ + diff --git a/inc/fatal.tpl b/inc/fatal.tpl new file mode 100644 index 0000000..610b2b4 --- /dev/null +++ b/inc/fatal.tpl @@ -0,0 +1,23 @@ + + + + + Message / Bulletin + + + + +
+

[tpl:message]

+
+
+

+ + [tpl:label] + +

+

Copyright © 2016 Bulletin Team

+ + diff --git a/inc/forgot.tpl b/inc/forgot.tpl new file mode 100644 index 0000000..4c4ed4d --- /dev/null +++ b/inc/forgot.tpl @@ -0,0 +1,23 @@ + + + + + Recover Your Bulletin Account + + + +
+
+

We're sorry you've lost access to your account!

+

To log in and change your password, click here.

+
+
+
+

Welcome back to Bulletin!

+

Copyright © 2016 Bulletin Team

+ + diff --git a/inc/functions.php b/inc/functions.php new file mode 100644 index 0000000..4e98342 --- /dev/null +++ b/inc/functions.php @@ -0,0 +1,67 @@ + $msg, 'link' => $link, 'label' => $label), 'fatal.tpl')); +} + +function gohome () { + global $b_config; + redirect($b_config['base_url']); +} + +function goin () { + l_redirect('dash/'); +} + +function loggedin () { + goin(); +} + +function l_redirect ($page) { + global $b_config; + redirect($b_config['base_url'].$page); +} + +function redirect ($url) { + header('Location: '.$url); + fatal('Redirecting...', $url); +} +?> diff --git a/inc/mobile.php b/inc/mobile.php new file mode 100644 index 0000000..634b008 --- /dev/null +++ b/inc/mobile.php @@ -0,0 +1,9 @@ + diff --git a/inc/user.php b/inc/user.php new file mode 100644 index 0000000..789586f --- /dev/null +++ b/inc/user.php @@ -0,0 +1,18 @@ + 0, +); + +if (empty($_COOKIE[$b_config['c_name']]) || !preg_match('/^(\d+);([0-9a-zA-Z\.]+)$/', $_COOKIE[$b_config['c_name']], $matches)) { + $b_user = $guest_user; +} +else { + $db = new bdb(); + $result = $db->query('SELECT * FROM users WHERE id = '.intval($matches[1]).' AND session = \''.hash('sha512', $matches[2]).'\' AND active = 1 LIMIT 1') or fatal($db->error); + if ($result->num_rows < 1) $b_user = $guest_user; + else $b_user = $result->fetch_assoc(); + $result->free(); + $db->close(); +} +?> -- cgit v1.2.3