94 lines
1.9 KiB
PHP
94 lines
1.9 KiB
PHP
<?php namespace Project\Controllers;
|
|
use DB, URL, Cookie, Session, ML, Method, Email, URI, Captcha, Validator, Import, Post, Guard;
|
|
|
|
/**
|
|
* Created By : Erkan IŞIK
|
|
* Created Date: 2017-12-06
|
|
* Update Date : 2018-11-24
|
|
*/
|
|
|
|
|
|
class Member extends Controller{
|
|
|
|
function main(){
|
|
if(Method::post()) {$this->user_model->logincheck(Method::post());}
|
|
}
|
|
|
|
function register(){
|
|
$token = Guard::csrftokenkey('register_token');
|
|
View::token($token);
|
|
}
|
|
|
|
function new_user(){
|
|
if (!Guard::validcsrftokenkey('register_token')) {
|
|
echo 'csrf';
|
|
return;
|
|
}
|
|
|
|
$post = Method::post();
|
|
|
|
if (Method::post('captcha') !== Captcha::getCode()) {
|
|
echo 'captcha';
|
|
return;
|
|
}
|
|
|
|
if ($post['password'] !== $post['password2']) {
|
|
echo 'match';
|
|
return;
|
|
}
|
|
|
|
if (strlen($post['password']) < 6) {
|
|
echo 'length';
|
|
return;
|
|
}
|
|
|
|
$data = $this->user_model->yeniuye($post);
|
|
|
|
if ($data) {
|
|
echo '1';
|
|
}
|
|
}
|
|
|
|
function emailcontrol(){
|
|
$this->user_model->emailcontrol(Method::post());
|
|
}
|
|
|
|
|
|
function aktivizasyon(){
|
|
$act = Uri::get('aktivizasyon');
|
|
DB::where('aktivizasyon',$act)->update('user',[
|
|
'aktivizasyon' => '',
|
|
'status' => '1',
|
|
]);
|
|
|
|
if (DB::affectedRows()) {view::control('1');}else{redirect('/');}
|
|
}
|
|
|
|
function password_forgot(){
|
|
if (method::post()) {$this->user_model->sifremiunuttum_model(method::post());}
|
|
|
|
}
|
|
|
|
function ref($data){
|
|
$exp = explode('-', $data);
|
|
$ref = $exp['0'].'/'.$exp['1'].'/'.$exp['2'].'-'.seo($exp['3']);
|
|
Session::insert('ref', $ref);
|
|
if(method::post()) {$this->user_model->logincheck(method::post());}
|
|
}
|
|
|
|
function yenisifre(){
|
|
$act = Uri::get('yenisifre');
|
|
if (method::post()) {$this->user_model->yenisifre(method::post());}
|
|
|
|
$id = DB::select('user_id')->where('aktivizasyon',$act)->get('user')->value();
|
|
$act = $act;
|
|
View::id($id)->act($act);
|
|
}
|
|
|
|
function logout(){
|
|
Session::deleteAll();
|
|
redirect(URL::base());
|
|
}
|
|
|
|
|
|
} |