81 lines
2.3 KiB
PHP
81 lines
2.3 KiB
PHP
<?php namespace Project\Controllers;
|
||
use DB, Method, Import, URL, Cookie, Session, URI, Email;
|
||
|
||
/**
|
||
* Created By: Erkan IŞIK
|
||
* Created Date: 2017-08-28
|
||
*/
|
||
class User extends Controller{
|
||
function __construct(){if (!USERID) {redirect(URL::base('panel'));}}
|
||
function main(){
|
||
$search = '';
|
||
if(Method::post('username')){
|
||
$search = DB::whereLike('username',method::post('username'))->userResult();
|
||
}
|
||
|
||
if(Method::post('email')){
|
||
$search = DB::where('mail',method::post('email'))->userResult();
|
||
}
|
||
|
||
View::active_member($search);
|
||
|
||
}
|
||
|
||
|
||
|
||
function pending_member(){
|
||
View::pending_member($this->member_model->pending_member());
|
||
}
|
||
|
||
function disable_member(){
|
||
View::disable_member($this->member_model->disable_member());
|
||
}
|
||
|
||
function passRename(){
|
||
$data['message'] = null;
|
||
if(method::post()){
|
||
$data['message'] = $this->login->passrename(method::post());
|
||
}
|
||
import::view('user/passRename',$data);
|
||
}
|
||
|
||
function deleteMemberAjax(){
|
||
$id = method::post('par');
|
||
DB::where('user_id',$id)->delete('user');
|
||
echo 'Üye Silinmiştir!';
|
||
}
|
||
|
||
function edit(){
|
||
if (method::post()) {$this->member_model->update(method::post());}
|
||
$edit = $this->member_model->edit(URI::get('edit'));
|
||
view::edit($edit);
|
||
|
||
}
|
||
|
||
|
||
function disableMemberAjax(){
|
||
$id = method::post('par');
|
||
DB::where('user_id', $id)->update('user',['status' => '2']);
|
||
if(!DB::error()) {echo 'Üye yasaklandı';}else{echo DB::error();}
|
||
}
|
||
|
||
function activemailSendAjax(){
|
||
$id = method::post('par');
|
||
$kisibul = DB::where('aktivizasyon', $id)->get('user')->row();
|
||
|
||
$mesaj = "
|
||
Merhaba $kisibul->username.<br>
|
||
Sitemize kayıt olduğunuz için teşekkür ederiz.<br>
|
||
Aşağıdaki linke tıklayarak üyeliğinizi aktif edebilirsiniz.<br>
|
||
<a href=\"http://pisilinux.org/member/aktivizasyon/$kisibul->aktivizasyon\">Üyelik aktif etmek için lütfen buraya tıklayın.</a><br>
|
||
<a href=\"https://t.me/joinchat/MAcpp0o6E4dAAoz090cDjA.\"> Telegram </a> pisilinux kanalında aramızda görmekten memnun oluruz.
|
||
";
|
||
|
||
Email::from('info@pisilinux.org','Pisi GNU/Linux')
|
||
->to($kisibul->mail)
|
||
->send('Pisilinux Üyelik İşlemleri', $mesaj);
|
||
|
||
echo "Aktivizasyon maili tekrardan gönderildi";
|
||
}
|
||
|
||
} |