Installation

Installation requirements

In order to successfully install and operate SlimarUSER your server must meet the following requirements

PHP 5.4 or higher
PHP PDO Extention
PHP Extention

File permissions

For a successful setup of SlimarUSER, you will need to change folder permissions.
The following will need the file permissions to be to be set as 777
files/uploads
inc/details.php
A simple guide on how to do this using FileZilla can be found here

Installing SlimarUSER

Now you are ready to install SlimarUSER. Firstly you will need to upload the contents of the downloaded ZIP file to a webserver that has the requirements listed above. After you have uploaded your files, you will now need to create a database. The installation wizard is very simple and easy to use.


Step 1

When going to your website, you should be greeted with an installation wizard which looks like the below image. The url should be something similar to yourdomain.com/install/. The first page will contain information about permissions that will be set. Make sure these permissions are set before continuing. Once ready, proceed by clicking "Install SlimarUSER"


Step 2

This is an important step, to make sure your database is installed correctly. By this point you should have already created a new database. Simply enter your database details in below. If you are unsure, contact your web host for information.


Step 3

This step should contain a notice stating that the configuration file was succesfully generated. If for some reason you have experienced an error, please return to step 1 and make sure the permissions are correct!


Step 4

This last step of the wizard will state that your installation was successful. You will be provided with the default login. admin@admin.com - admin123.
As soon as you are able to login, please change these immediately!


Step 5

As soon as you are logged in, and after you have changed the default email and password, you should straight away head to the administration panel, and fix up the site settings. The main settings that should be changed are, the title, email address and of course the site url. Once finished, your site is ready!

Login & Registeration

SlimarUSER provides two already set up login pages, and also a login in the top navigation. After login, cookies will be set for the users login. This will contain the user id, and the password. At each action throughout the site, this password and id will be checked from the database to see if it is correct, to be secure. Once logged in, the user will be redirected to the administrators chosen page. By default this will be the dashboard.php.

Users are able to create an account by going to the registeration page. This page will be signup.php. If wanting to, the administrator can choose to turn registeration off by the Administration Panel under site settings. This will disallow anyone to register.

On both the login, and registeration are opptional captchas. These can be turned off indivudually for either registeration or login by the site settings in the admin panel.

SlimarUSER contains a password reset feature, to allow users to reset their password incase they forget it. The user will be able to enter their email address, and an email will be sent out. The website administrator MUST enter their email address and web host email server in the site settings in the administration panel for this to correctly function.

Extending the usage of SlimarUSER

You can use the SlimarUSER system for many different projects. You can use it as a standlone website as it stands currently, or you can use it to build a new website as a starting point, or you can integrate it into your existing website. Below you will find out how to use the features of SlimarUSER to your advantage.

Page requirements

At the top of EVERY page, should be the below code. This is the requirement of the config.php file. This config is the most important thing for the use of SlimarUSER. The config file controls the database, functions, and manages the user features.
<?php
ob_start(); require "inc/config.php";
?>


Getting site information

You can easily recieve any particular site information. Put the following codes anywhere that is relevant to you
Site title: <?php echo $i['title']; ?>
Site url: <?php echo $i['url']; ?>


Getting signed in user information

This will help you retrieve the current signed in users information.
Username: <?php echo $in['username']; ?>
Usergroup [ID]: <?php echo $i['usergroup']; ?>
Usergroup [Name]: <?php echo $in_perm['name']; ?>
First name: <?php echo $in['firstname']; ?>
Country: <?php echo $in['country']; ?>
Gender: <?php echo $in['gender']; ?>
Email address: <?php echo $in['email']; ?>
URL to profile picture: <?php echo $in['profilepic']; ?>


Checking if statements

Using if statements around certain things will allow you to check if certain things are true.
If is logged in <?php if($in['id']){ ?> [Show if logged in here] <?php } ?>

If not logged in <?php if(!$in['id']){ ?> [Show if not logged in here] <?php } ?>

If has administration rights <?php if($in_perm['has_admin'] == "1"){ ?> [Show if admin] <?php } ?>

If verified <?php if($in['verified'] == "1"){ ?> [Show verified here] <?php } ?>

If has certain permission <?php if($in_perm['(PERMISSION HERE)'] == "1"){ ?> [Show if permission true here] <?php } ?>


User logging in and registeration

Login
Allowing users to login or register by any form is simple.

The form must have method="post". One input with the type email and name="email", another input with the type password and name="password".
To finish this form off, it must have a input button with name="login". You should also include a PHP if statement to check if captchas are enabled. Check the below example to check how this is done.

Example complete code:
<form method="post">
	<input placeholder='Email address' name='email' type='email'>
	<input placeholder='Password' name='password' type='password'>	
	
	<?php if($i['captcha'] == "1"){ ?> 
		<img src="inc/captcha.php" style="float:left;"/>
		<input placeholder='Captcha' maxlength="4" style="width:225px"  name="captcha" type="text">
	<?php }?>
	
	<input type="submit" name="login" value="Login">
</form>
									

Registeration
As the same with the login, the form must have method="post". Text field with name="username"name="firstname", email input with name="email", date type with name="dob", password input with name="password", a password input with name="password2", and a text input with name="refer". An input button should be included with name="register". As again, you should also include a PHP if statement to check if captchas are enabled. Check the below example.
<form class="form" method="post">
	<input type="text" name="username" placeholder="Username" required>
	<input type="text" name="firstname" placeholder="First name" required>
	<input type="email" name="email" placeholder="Email address" required>
	<input type="date" name="dob" placeholder="Email address" required>
	<input type="password" name="password" placeholder="Password" required>
    <input type="password" name="password2" placeholder="Password" required>
    <input type="text" name="refer" placeholder="" value="">
                                             
	
		<img src="inc/captcha.php" style="float:left;"/>
		<input placeholder='Captcha' style="width:170px;padding:9px;color:#272727;" maxlength="4" name="captcha" type="text">
	
			
	<input type="submit" name="register" class="btn btn-pink btn-block" value="Register">
</form>									
									

Integration

If you already have a PHP powered website, you may be wanting to integrate SlimarUSER into it. Below you will be able to learn how to do this.

1. First you should make sure you have copied over the contents of the inc/ directory. You may remove the folder themes if wanting to.
2. Every page that you create/have should have the below code at the top of the page
<?php
ob_start(); require "inc/config.php";
?>

3. Your website should now be partly operated by SlimarUSER. Make sure if you have not done so already, to run the installation wizard to set up your database and details.php file.
4. To get certain information like site title, or signed in user, please check out the above information under "Extending the usage of SlimarUser.

You will be able to go through the example pages provided with SlimarUSER to find out more. Example to find out how to secure your website go check out secure.php.