UserSpice Knowledgebase

Check out our Getting Started Guide

ID Item Type Purpose View Details
261 action Method This method is used internally by the DB class to pass SQL queries and tables to the database View
312 addError Method Adds an error message when an item fails validation View
56 addPage Function Add a permission level to a page View
65 addPermission Function Adds a permission level to a user View
331 Adjusting the session length so a user is logged out sooner or stays logged in longer Guide Extending the time a user stays logged in is not as simple as it seems View
104 Azure Guide Learn how to connect to an Azure database View
184 bin Function Echoes a green Yes, red No, or blue Other depending on what is passed to it. View
15 bold Function Puts a bold message at the top of a page View
277 cell Method Retrieve a single value from a specific row and column in a database table, using a simplified syntax that allows the table and column names to be specified View
297 check Method Checks for the presence of a valid CSRF token View
311 check Method The check() method in the Validate class checks the validity of input data based on a set of predefined rules. View
131 checkAccess Function Check if the currently logged in user has permission to access a particular page or resource. View
230 checkAPIkey Function Used to validate the format an API key entered by a user View
196 checkBan Function Checks to see if an IP address is banned from accessing your site View
61 checkMenu Function Check if a user has a permission level View
147 checkPermission Function View
303 checkUser Method Checks if a user has Google oAuth credentials and updates their information accordingly. View
189 clean Function Sanitizes a given string by removing special characters and replacing spaces with hyphens. View
129 cleanupPermissionPageMatches Function Cleans up orphaned permission-page matches View
69 Config::get Method Retrieves a configuration value from the $GLOBALS['config'] array. View
76 Cookie::delete Method Expires cookie View
73 Cookie::exists Method Checks if a given cookie exists View
74 Cookie::get Method Get's the cookie and assigns it to a variable View
75 Cookie::put Method Puts a cookie on the user's system View
270 count Method View
299 create Method View
55 createPages Function Adds a page to the Database View
212 currentFile Function The function is used to determine the current page URL, which can be useful for generating links or performing other operations that are specific to the current page. View
4 currentFolder Function Returns the folder of the current file View
3 currentPage Function Returns the file name of the current page (not including path) View
149 currentPageId Function Retrievse the ID of the current page based on the URI View
204 currentPageStrict Function Only return a page ID if the page is marked as "active" in the database. This can be useful in cases where you only want to allow access to certain pages. View
123 Customizing the Dashboard Guide Personalize your Dashboard to your liking View
121 Customizing UserSpice Guide The definitive guide for customizing UserSpice View
305 data Method View
254 delete Method View
264 delete Method View
292 delete Method View
265 deleteById Method View
50 deletePages Function Deletes pages from the database View
66 deletePermission Function Deletes multiple permission levels View
37 deleteUsers Function Deletes multiple users View
219 deRegisterHooks Function Used to disable all hooks registered by a specific plugin. View
237 display Method View
9 display_errors Function Deprecated. Do Not Use. View
314 display_errors Method View
10 display_successes Function Deprecated. Do Not Use. View
14 dnd Function Provides a formatted var_dump of a variable and kills the page View
13 dump Function Provides a formatted var_dump of a variable View
193 echodatetime Function View
158 echoId Function View
183 echoId Function Simplifies the process of retrieving a specific value from a table in the database by providing a convenient wrapper function. View
68 echopage Function Echoes page name when given a page id View
38 echouser Function A flexible function to echo out some type of user name View
39 echousername Function Returns the username of the user. Does not actually echo it. View
11 email Function Send an email if properly configured View
156 emailExists Function View
181 emailExists Function View
12 email_body Function Predefined email templates can be stored in users/views View
191 encodeURIComponent Function Used to encode a string of text to be used in a URL, where certain characters may have special meaning and need to be encoded for the URL to be valid. View
16 err Function Puts a red message at the top of a page View
271 error Method View
272 errorInfo Method View
316 errors Method View
273 errorString Method View
251 exists Method View
283 exists Method View
290 exists Method View
304 exists Method View
207 fetchAdminSessions Function Retrieves user session data from the database. View
51 fetchAllPages Function Grabs all pages from the database View
62 fetchAllPermissions Function Grabs all permission levels View
35 fetchAllUsers Function Fetches an object of users based on the parameters included View
234 fetchFolderFiles Function Retrieves all the files in a folder with a given file extension. View
171 fetchGroupsByMenu Function View
52 fetchPageDetails Function Returns information about a page based on id View
58 fetchPagePermissions Function Returns a list of permission levels that can access a page View
44 fetchPermissionDetails Function Retrieves the details of a page with a specific ID from the database. View
59 fetchPermissionPages Function Retrieves the pages associated with a particular permission ID. View
47 fetchPermissionUsers Function Retrieves a list of users who have a permission level. View
233 fetchProfilePicture Function Retrieve the profile picture of a user with the given user ID. View
127 fetchUser Function Returns everything in the users table for a given user id View
36 fetchUserDetails Function Legacy function to retrieves info on a single user View
41 fetchUserName Function Returns First and Last Name of user View
46 fetchUserPermissions Function Retrieve the permissions assigned to a user with the given user ID. View
206 fetchUserSessions Function Retrieves user session data from the database for the currently logged-in user. View
300 find Method View
259 findAll Method View
260 findById Method View
269 first Method View
294 flash Method View
113 Form manager advanced features Guide Advanced form processing View
112 Form manager basics Guide Understanding the form manager plugin View
238 generate Method View
296 generate Method View
186 generateAddForm Function Generates an HTML form for adding a new record to a specified database table. View
185 generateForm Function View
250 get Method View
252 get Method View
263 get Method View
284 get Method View
293 get Method View
278 getColCount Method View
279 getColMeta Method View
257 getDB Method View
256 getInstance Method View
216 getMyHooks Function This function retrieves the hooks for the current page or for a specific page passed as a parameter, and groups them by their position. View
151 getPageFiles Function Retrieves a list of PHP files located in a specified directory. It then modifies the file paths to make them relative to the UserSpice installation directory. View
175 getPageFiles Function Used to get an array of PHP files in the parent directory of the script file. View
49 getPathPhpFiles Function Retrieve a list of all .php files in folder View
275 getQueryCount Method View
122 Getting Started Guide What to do after installing UserSpice View
150 getUSPageFiles Function View
176 getUSPageFiles Function Retrieves all PHP files in the users/ directory and return them as an array. View
170 get_gravatar Function Used to generate a Gravatar URL for a given email address. View
276 get_subquery_sql Method View
70 Hash::make Method Creates an SHA-256 hash (optionally salted hash) from a string View
72 Hash::unique Method Create a unique, time-based hash View
67 hasPerm Function Allows you to check if a user group has a certain permission level View
240 hasPerms Method View
213 importSQL Function Imports a SQL file into the database. View
217 includeHook Function Includes plugin hooks at a specific position in the application. View
85 Input::exists Method Checks if $_GET or $_POST form input exists View
86 Input::get Method Gets and sanitizes form input for form processing. View
87 Input::sanitize Method Sanitizes non form data for storage in the database View
148 inputBlock Function Generates an HTML block containing a form input field with a label, optional help button, and helper text. View
266 insert Method View
103 Installation Issues Guide Learn how to diagnose common installation issues View
167 ipCheck Function Used to get the IP address of the user accessing the website. View
168 ipCheckBan Function Checks if the user's IP address is on the blacklist and not on the whitelist. View
195 ipReason Function Used to display the reason for an IP ban or whitelist. View
42 isAdmin Function Returns whether or not a user has permission level 2 View
203 isLocalhost Function Checks whether the current visitor's IP address is that of a local host. View
306 isLoggedIn Method View
229 isSelected Function Used to check if two values are equal, and if they are, it returns the specified output (default: "selected='selected'") View
130 isStandardUser Function Used to check whether a user has the standard user permission or not. View
228 isUserLoggedIn Function Used to check whether the user is currently logged in or not. View
180 isValidEmail Function Used to check whether an email address is valid or not. View
287 json Method View
208 killSessions Function Used to end a user session or multiple user sessions in the database. View
179 lang Function Used to retrieve language strings based on a specified key. View
114 Language and Translation Guide Learn how to translate UserSpice and edit translations View
215 languageSwitcher Function Used to display a language switcher on a webpage. It allows users to switch between different language translations of a website. View
274 lastId Method View
192 logger Function Used to log various activities performed by users on a website. View
301 login Method View
302 loginEmail Method View
202 lognote Function Allows you to customize the content of the admin logs. View
308 logout Method View
280 make Method View
120 Master Account Guide Understanding the Master Account system View
166 migrateUSMainMenu Function Used to migrate the main menu items from an old version of Userspice to a newer version. View
242 miniMap Method View
243 miniMapLinks Method View
7 money Function Formats numbers to US currency format View
107 Monitoring additional folders Guide Learn how to control folders with UserSpice View
8 name_from_id Function Returns the username when given a user's id View
128 name_from_id Function Another legacy function that fetches a username from a user id View
307 notLoggedInRedirect Method View
235 offsetDate Function A utility function in UserSpice that returns a date offset by a certain number of units, based on the input parameters. View
146 output_message Function View
211 oxfordList Function Takes an array of strings and an optional array of options as its parameters. It returns a string that is a grammatically correct list of the items in the array. View
53 pageIdExists Function Tells whether a page id is used in UserSpice View
159 parseMenuLabel Function Used to parse a label string for a menu item. View
223 parseSessionMessages Function Used to retrieve and parse session messages that have been set using the setGenMsg, setValSuc, and setValErr functions View
17 parse_ini_file Function Internal use only View
165 parse_menu_hook Function Used to replace strings in a given input string using an array of replacements. View
317 passed Method View
209 passwordResetKillSessions Function Used to end all user sessions except the current session when a password reset is initiated. View
109 Permission Levels Guide View
43 permissionIdExists Function Tells whether a permission id exists in UserSpice View
64 permissionNameExists Function Tells whether a permission name exits in UserSpice View
152 permissionNameExists Function View
119 Plugin hooks Guide Learn how to use your plugins to inject code into existing UserSpice pages View
214 pluginActive Function Check if a plugin is active, with a redirect back to the Plugin Manager if not [optional] View
163 prepareDropdownString Function The prepareDropdownString function in UserSpice is a custom function used to generate a string of HTML code for a dropdown menu item with its children items. View
162 prepareIndentedMenuTree Function The prepareIndentedMenuTree function in UserSpice is a custom function used to retrieve a menu tree and indent it based on a specified property. View
164 prepareItemString Function The prepareItemString function in UserSpice is a custom function used to generate an HTML string representing a menu item based on the provided menu item data. View
161 prepareMenuTree Function The prepareMenuTree function in UserSpice is a custom function used to build a hierarchical menu tree structure based on the provided menu data. View
253 put Method View
291 put Method View
258 query Method View
169 randomstring Function The randomstring function in UserSpice is used to generate a random string of a specified length. It uses a combination of uppercase letters, lowercase letters, and digits. View
197 random_password Function The random_password function in UserSpice is a custom function used to generate a random password with a specified length. View
286 recursive Method View
239 recursivelyDeleteMenuItem Method View
22 redirect Function Redirect to another page View
218 registerHooks Function The registerHooks function in UserSpice is a custom function used to register hooks for plugins. Hooks allow plugins to integrate with specific points in the UserSpice framework, enabling custom functionality and extending core features. View
60 removePage Function Removes a page from permission_page_matches View
48 removePermission Function The removePermission function in UserSpice is a custom function used to remove permission assignments between users and permissions in the user_permission_matches table of the database. View
200 requestCheck Function The requestCheck function in UserSpice is a custom function used to check and retrieve request variables from $_GET and $_POST superglobal arrays. It ensures that the expected variables are present in the request and returns them as an array. If any expec View
178 resultBlock Function View
268 results Method View
198 returnError Function The returnError function in UserSpice is a custom function used to return an error response in JSON format and terminate the script execution. View
313 ruleBroken Method View
315 rulesBroken Method View
289 safe Method The purpose of this method is to safely redirect users to a given location, after checking if the location is valid and accessible. View
19 safefilerewrite Function Write data to a file in a safe and secure manner, using file locking to prevent race conditions where multiple processes or threads might attempt to write to the same file at the same time. View
281 salt Method View
2 sanitize Function Sanitizes a string, array or object using the Input class and returns it. View
285 sanitize Method View
177 sanitizedDest Function The sanitizedDest function in UserSpice is used to sanitize and validate a destination URL parameter. It checks if the destination is a legitimate page in the database or if it has been whitelisted by the administrator. View
57 securePage Function The securePage function in UserSpice is used to secure pages by restricting access based on user authentication and permissions. It verifies if a page should be accessible or if the user should be redirected to a login page or denied access. View
116 Security Audit - 4.4 Guide A 3rd party audited v 4.4.09 View
78 Session::delete Method Deletes the current session View
77 Session::exits Method Checks for the existence of a session View
80 Session::flash Method Refreshes a session View
79 Session::get Method Gets the value of a session View
82 Session::put Method Adds information to a user\'s session View
81 Session::uagent_no_version Method Returns some basic info about the visitor's system View
224 sessionValMessages Function View
245 setInitialDisplayOrder Method View
244 setInitialTypes Method View
106 Setting up Email Guide Learn how to configure your email server View
220 shakerIsInstalled Function The shakerIsInstalled function in UserSpice is used to check if a shaker item (translation, plugin, widget, or template) is installed. View
1 size Function Returns the size of a file View
115 Social Logins Guide Setup google and facebook logins (now plugins) View
124 Spice Shaker Guide Install official and community addons View
153 stripPagePermissions Function View
190 stripPagePermissions Function The stripPagePermissions function in UserSpice is used to remove page permissions for a given page ID. View
125 Templates (Themes) Guide Learn how to customize the look and feel of UserSpice View
194 time2str Function The time2str function in UserSpice is used to convert a timestamp to a human-readable time string representing the elapsed time since the provided timestamp. View
288 to Method View
84 Token::check Method Checks if the token in the session matches the token posted in the form View
83 Token::generate Method Generates a token and saves it to a session variable. View
232 tokenHere Function The tokenHere function in UserSpice is used to generate and output a CSRF (Cross-Site Request Forgery) token as a hidden input field in an HTML form. View
295 uagent_no_version Method View
330 UltraMenu Guide Guide to the new UserSpice UltaMenu View
126 Understanding Usersc Guide Learn about the magic of the usersc folder View
282 unique Method View
267 update Method View
309 update Method View
157 updateEmail Function View
182 updateEmail Function The updateEmail function in UserSpice is used to update the email address of a user in the database. View
187 updateFields2 Function The updateFields2 function in UserSpice is used to process and sanitize the fields of a POST request, excluding any fields specified in the $skip array. View
172 updateGroupsMenus Function The updateGroupsMenus function in UserSpice is used to update the relationship between groups and menus in the database. It removes the existing associations for the specified menu IDs and then adds new associations for the provided group IDs and menu IDs View
45 updatePermissionName Function The updatePermissionName function in UserSpice is used to update the name of a permission in the database. View
54 updatePrivate Function The updatePrivate function in UserSpice is used to update the privacy setting of a page in the database View
40 updateUser Function Updates a single piece of user data View
108 Upgrading from 3.x to 4.0 Guide Learn how to make the jump View
110 User Management Guide Learn how to manage your users View
93 user->checkUser Method Internal use only View
89 user->create Method Creates a new UserSpice user and returns the id View
95 user->data Method Provides quick access to a piece of info about a logged in user View
94 user->exists Method Checks if a user is logged in and the user class is instantiated View
90 user->find Method Finds if a user exists based on id, username, or email View
96 user->isLoggedIn Method Checks if a user is logged in View
91 user->login Method Logs in a user View
92 user->loginEmail Method Logs in a user with an email address instead of username View
98 user->logout Method Logs out a user View
97 user->notLoggedInRedirect Method A conditional redirect statement View
99 user->update Method Updates an array of fields in the user table for the logged in user View
154 userHasPermission Function View
34 userIdExists Function Check if the provided User ID exists in the users table View
155 usernameExists Function View
174 usernameExists Function The usernameExists function in UserSpice is a custom function used to check if a username already exists in the users table of the database. View
210 username_helper Function The username_helper function in UserSpice is used to generate a unique username based on the provided first name, last name, and email address. View
225 usError Function View
205 UserSessionCount Function The UserSessionCount function in UserSpice is used to retrieve the number of active user sessions for the currently logged-in user. View
231 UserSpice_getLogs Function The UserSpice_getLogs function is a function in the UserSpice framework that retrieves logs from the database based on the provided options. View
117 Using the database Guide Learn how to use the database with video and text tutorials View
227 usMessage Function The usMessage function in UserSpice is a utility function used to display a message to the user. It stores the message in the session for later retrieval. View
226 usSuccess Function The usSuccess function in UserSpice is used to display a success message to the user by storing it in the session. View
222 validateJson Function The validateJson function in UserSpice is used to validate if a given string is a valid JSON. View
221 verifyadmin Function The verifyadmin function in UserSpice is used to check if the user is an administrator and verify their admin status View
18 write_php_ini Function Takes an associative array of configuration values and a file path as arguments, and writes the values to a ini file View
118 Writing a plugin Guide See an example of how to write your own plugin View
160 _assert Function View
262 _calcWhere Method View
241 _generateHtml Method View
249 _loadItems Method View
248 _loadTree Method View
246 _populateInitialDisplayOrder Method View
247 _populateTypeColumn Method View