clipbucket/upload/signup.php

98 lines
2.5 KiB
PHP
Raw Normal View History

2013-10-07 12:17:06 +00:00
<?php
2016-06-08 22:49:28 -07:00
2017-01-10 12:49:44 +05:00
/**
2013-10-07 12:17:06 +00:00
*************************************************************
2017-01-10 12:49:44 +05:00
| Copyright (c) 2007-2017 Clip-Bucket.com. All rights reserved.
| @ Author : Arslan Hassan
2016-06-08 22:49:28 -07:00
| @ Software : ClipBucket
2017-01-10 12:49:44 +05:00
| @ Modified : { January 10th, 2017 } { Saqib Razzaq } { Updated copyright date }
2013-10-07 12:17:06 +00:00
*************************************************************
*/
2016-06-08 22:49:28 -07:00
define("THIS_PAGE","signup");
define("PARENT_PAGE","signup");
2013-10-07 12:17:06 +00:00
2016-06-08 22:49:28 -07:00
require 'includes/config.inc.php';
global $Cbucket,$userquery;
if($userquery->login_check('',true)) {
redirect_to(BASEURL);
}
2013-10-07 12:17:06 +00:00
/**
* Function used to call all signup functions
*/
if(cb_get_functions('signup_page')){
cb_call_functions('signup_page');
}
2016-06-08 22:49:28 -07:00
2013-10-07 12:17:06 +00:00
/**
* Signing up new user
*/
2014-03-27 10:48:18 +00:00
if(!config('allow_registeration')){
assign('allow_registeration',lang('usr_reg_err'));
//
}
2016-06-08 22:49:28 -07:00
2013-10-07 12:17:06 +00:00
if(isset($_POST['signup'])){
2014-03-27 10:48:18 +00:00
if(!config('allow_registeration')){
2013-10-07 12:17:06 +00:00
e(lang('usr_reg_err'));
2016-06-08 22:49:28 -07:00
} else {
2015-10-28 12:11:04 +00:00
$form_data = $_POST;
$signup_data = $form_data;
$signup_data['password'] = mysql_clean(clean($signup_data['password']));
$signup_data['cpassword'] = mysql_clean(clean($signup_data['cpassword']));
2015-10-28 12:11:04 +00:00
$signup_data['email'] = mysql_clean($signup_data['email']);
$signup = $userquery->signup_user($signup_data,true);
2016-06-08 22:49:28 -07:00
// checking if user signup was successful
if($signup) {
// user signed up, lets get his details
2013-10-07 12:17:06 +00:00
$udetails = $userquery->get_user_details($signup);
$eh->flush();
assign('udetails',$udetails);
if (empty($Cbucket->configs['email_verification'])) {
2016-06-08 22:49:28 -07:00
// login user and redirect to home page
$userquery->login_as_user($udetails['userid']);
header("Location: ".BASEURL);
} else {
assign('mode','signup_success');
}
2013-10-07 12:17:06 +00:00
}
}
}
2016-06-08 22:49:28 -07:00
//Login User
if(isset($_POST['login'])){
$username = $_POST['username'];
$username = mysql_clean(clean($username));
$password = mysql_clean(clean($_POST['password']));
2013-10-07 12:17:06 +00:00
2016-06-08 22:49:28 -07:00
$remember = false;
if($_POST['rememberme'])
$remember = true;
if($userquery->login_user($username,$password,$remember)) {
if($_COOKIE['pageredir']) {
redirect_to($_COOKIE['pageredir']);
} else {
redirect_to(cblink(array('name'=>'my_account')));
}
}
2013-10-07 12:17:06 +00:00
}
2016-06-08 22:49:28 -07:00
//Checking Ban Error
if(!isset($_POST['login']) && !isset($_POST['signup'])){
if(@$_GET['ban'] == true){
$msg = lang('usr_ban_err');
}
2013-10-07 12:17:06 +00:00
}
2014-06-02 07:07:29 +00:00
2016-06-08 22:49:28 -07:00
subtitle(lang("signup"));
//Displaying The Template
template_files('signup.html');
2017-08-07 12:01:43 +05:00
display_it();
2014-06-02 07:07:29 +00:00
2016-06-08 22:49:28 -07:00
?>