Sponsorenverwaltung - Team StarCraft e.V.
 All Data Structures Files Functions Variables
config_usercake.php
Go to the documentation of this file.
1 <?php
2  /**
3  * @file config_usercake.php
4  *
5  * @brief Basic configuration for most of the usermanagement tasks can be done from here
6  *
7  * @details
8  * This file is based on config.php from Usercake (Version 2.0.2) with some major
9  * adjustements from Daniel Seichter and Alexander Vorndran.
10  *
11  * This file recquires inc/libs/usercake/languages/de.php, inc/libs/usercake/functions_usercake.php,
12  * inc/libs/usercake/class.newuser.php, inc/libs/usercake/class.user.php, inc/libs/usercake/class.mail.php.
13  *
14  * @copyright (c) 2013, Team StarCraft e.V.
15  * @version 1.0.0
16  * @author UserCake (http://usercake.com)
17  * @author Alexander Vorndran
18  * @author Daniel Seichter
19  * @date 02.07.2013
20  */
21 
22 // // Retrieve settings from the database
23 // $stmt = $mysqli->prepare("SELECT id, name, value
24 // FROM ".$db['configuration']);
25 // $stmt->execute();
26 // $stmt->bind_result($id, $name, $value);
27 //
28 // while ($stmt->fetch()) {
29 // $settings[$name] = array('id' => $id, 'name' => $name, 'value' => $value);
30 // }
31 // $stmt->close();
32 
33  //Set Settings
34  //! Directory for email-templates
35  $mail_templates_dir = "mail-templates/";
36 
37  //! Name of the website
38  $websiteName = "Sponsorenverwaltung Team StarCraft e.V.";
39 
40  //! URL of the website
41  $websiteUrl = 'localhost/';
42 
43  /**
44  * Email-address that appears in the 'from' field in an email-client
45  * Doesn't realy need to be existent
46  */
47  $emailAddress = "sponsoring@teamstarcraft.de";
49 
50  //! Specification for email date and time
51  $emailDate = date('d.m.Y (H:i:s)');
52 
53  //! Location of the language file
54  $language = ABS_PATH."libs/usercake/languages/de.php";
55 
56  // BEGIN DANGEROUS
57  //!user id of the master account
58  define('MASTER_ACCOUNT', -1);
59  // END DANGEROUS
60 
61  /**
62  * User with this is id becomes administrator on registration automatically
63  * and is set active immediately on registration
64  */
65  define('DEFAULT_ADMIN_ACCOUNT', 1);
66 
67  //! id of the standard permission level of an administrator
68  define('ADMIN_PERMISSION', 1);
69 
70  //! id of the standard permission level for newly created users
71  define('STANDARD_PERMISSION', 2);
72 
73  //! Standard title of a new user
74  define('NEW_USER_TITLE', 'Benutzer');
75 
76  //! Allows or permits the permanent deletion of a user
77  define('ALLOW_PERMANENT_DELETION', TRUE);
78 
79  /**
80  * allow access to pages that are not in the pages database
81  * if set to FALSE a page has to be marked as public if it
82  * should be available for everybody
83  */
84  define('ALLOW_ANONYMOUS_ACCESS', FALSE);
85 
86  //! state of a locked page
87  define('PAGE_LOCK',2);
88 
89  //! state of a private page
90  define('PAGE_PRIVATE', 1);
91 
92  //! state of a public
93  define('PAGE_PUBLIC',0);
94 
95  /**
96  * status of a page when it's freshly added to the DB
97  * - PAGE_PUBLIC -> public access for everyone
98  * - PAGE_PRIVATE -> private access for registered users
99  * - PAGE_LOCK -> only for administrators
100  */
101  define('STANDARD_PAGE_ACCESS', PAGE_LOCK);
102 
103  //! page that should be displayed after successful login
104  define('PAGE_AFTER_LOGIN','home.php');
105  // TODO: move to common.php
106 
107  /**
108  * that value is written to the database if no session is active
109  * or a session is declared invalid
110  */
111  define('RESET_SESSION_ID', '0');
112 
113  /**
114  * defines the session auto-timeout in seconds (default 600s = 10 min)
115  * a value less than 1 means no session timeout
116  */
117  define('AUTO_TIMEOUT',600);
118 
119  /**
120  * number of iterations for password-stretching during hashing process
121  * should be 10 or more but has to be less or equal 99
122  */
123  define('WORKING_FACTOR',12);
124 
125  //! Allow changing the username
126  define('ALLOW_USERNAME_UPDATE', TRUE);
127 
128  //! Default strings that can be used in email-templates
129  $default_hooks = array("#WEBSITENAME#","#WEBSITEURL#","#DATE#");
130 
131  //! Default replacements for hooks defined in $default_hooks
133 
134  // Pages to require
135  require_once($language);
136  require_once("class.mail.php");
137  require_once("class.user.php");
138  require_once("class.newuser.php");
139  require_once("functions_usercake.php");
140 
141  // start session for userCakeUser
142  session_start();
143 
144  // Global User Object Var
145  if(isset($_SESSION["userCakeUser"]) && is_object($_SESSION["userCakeUser"])) {
146  //! loggedInUser can be used globally if constructed
147  $loggedInUser = $_SESSION["userCakeUser"];
148  }
149 
150 ?>