smsonayla.org - c99shell

!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: LiteSpeed. PHP/7.4.33 

uname -a: Linux server704.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13
UTC 2025 x86_64
 

uid=1309(necipbey) gid=1314(necipbey) groups=1314(necipbey) 

Safe-mode: OFF (not secure)

/home/necipbey/public_html/app/Controllers/   drwxr-xr-x
Free 3473.26 GB of 4265.01 GB (81.44%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     Chat.php (9.44 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace App\Controllers;


class 
Chat extends BaseController
{
    public function 
index()
    {
        if (!
user() || user()['admin'] != '1') {
            return 
redirect()->to('/login');
        }
        if (
settings('chat_active') == 'false') {
            return 
redirect()->to('/admin');
        }
        
$data['page'] = createMeta('Kayıtlı Mesajları Görüntüle');
        
$data['messages'] = db('chat')
            ->
where([
                
'chat_ust' => '0'
            
])
            ->
get()
            ->
getResultArray();
        
$data["ustSoru"] = db('chat')->get()->getResultArray();
        return 
view(currentTheme() . '/Admin/chat'$data);
    }
    public function 
deleteChat($hash)
    {
        if (!
user() || user()['admin'] != '1') {
            return 
redirect()->to('/login');
        }
        if (
settings('chat_active') == 'false') {
            return 
redirect()->to('/admin');
        }
        
db('chat')->delete([
            
'chat_hash' => $hash
        
]);
        return 
redirect()->to('admin/chat-settings');
    }
    public function 
updateChat($hash)
    {
        if (!
user() || user()['admin'] != '1') {
            return 
redirect()->to('/login');
        }
        if (
settings('chat_active') == 'false') {
            return 
redirect()->to('/admin');
        }
        
$soru db('chat')->where(['chat_hash' => $hash])->get()->getResultArray();
        
$sorular db('chat')->where(['chat_ust' => $hash])->get()->getResultArray();
        if (empty(
$soru)) {
            return 
redirect()->to('admin/chat-settings');
        }
        
$soru $soru[0];
        
$r $this->request;
        
$soruBasligi $r->getPost('soruBasligi');
        
$ustSoru $soru["chat_hash"];
        if (
$r->getPost('ustSoru') != '0') {
            
$soruBasligi db('chat')->where(array('chat_hash' => $r->getPost("ustSoru")))->get()->getResultArray()[0]["chat_cevap"];
            
$ustSoru $r->getPost('ustSoru');
        }
        
db('chat')->update([
            
'chat_soru' => $soruBasligi,
            
'chat_anaSoru' => $r->getPost('anaSoruMu'),
            
'chat_aciklama' => $r->getPost('aciklama'),
            
'chat_ustSoru' => $ustSoru
        
], ['chat_hash' => $hash]);

        foreach (
$r->getPost('cevap') as $key => $value) {
            if (
$value != null) {
                
$s db('chat')->where(['chat_hash' => $key])->get()->getResultArray();
                if (!isset(
$s[0]['chat_hash'])) {
                    
db("chat")->insert([
                        
"chat_hash" => md5(uniqid() . rand() . time() . microtime() . uniqid()),
                        
"chat_ust" => $hash,
                        
"chat_cevap" => $value,
                        
"chat_ustSoru" => $ustSoru,
                        
"chat_aciklama" => $r->getPost('aciklama')
                    ]);
                } else {
                    
db('chat')->update([
                        
"chat_ust" => $hash,
                        
"chat_cevap" => $value,
                        
"chat_ustSoru" => $ustSoru,
                        
"chat_aciklama" => $r->getPost('aciklama')
                    ], [
'chat_hash' => $key]);
                }
            }
        }

        return 
redirect()->to('admin/chat-settings/edit/' $hash);
    }
    public function 
editChat($hash)
    {
        if (!
user() || user()['admin'] != '1') {
            return 
redirect()->to('/login');
        }
        if (
settings('chat_active') == 'false') {
            return 
redirect()->to('/admin');
        }
        
$data['page'] = createMeta('Mesaj Düzenle');
        
$data['messages'] = db('chat')
            ->
where([
                
'chat_ust' => '0'
            
])
            ->
get()
            ->
getResultArray();
        
$data['soruDetay'] = db('chat')->where(['chat_hash' => $hash])->get()->getResultArray();
        if (empty(
$data['soruDetay'])) {
            return 
redirect()->to('admin/chat-settings');
        }
        
$data['soruDetay'] = $data['soruDetay'][0];
        
$data['cevaplar'] = db('chat')->where([
            
'chat_ust' => $hash
        
])->get()->getResultArray();

        
$data["ustSoru"] = db('chat')->get()->getResultArray();
        return 
view(currentTheme() . '/Admin/editChat'$data);
    }
    public function 
addChat()
    {
        if (!
user() || user()['admin'] != '1') {
            return 
redirect()->to('/login');
        }
        if (
settings('chat_active') == 'false') {
            return 
redirect()->to('/admin');
        }
        
$req $this->request;
        
$soruBasligi $req->getPost('soruBasligi');

        if (
$req->getPost('ustSoru') !== '0') {
            
$soruBasligi db('chat')->where(array('chat_hash' => $req->getPost("ustSoru")))->get()->getResultArray()[0]["chat_cevap"];
        }

        
$hash md5(uniqid() . rand() . time() . microtime() . uniqid());
        
$ustSoru $hash;
        if (
$req->getPost("ustSoru") != "0") {
            
$ustSoru $req->getPost("ustSoru");
        }

        
db('chat')->insert(
            [
                
"chat_hash" => $hash,
                
"chat_ust" => "0",
                
"chat_soru" => $soruBasligi,
                
"chat_cevap" => "0",
                
"chat_anaSoru" => $req->getPost("anaSoruMu"),
                
"chat_ustSoru" => $ustSoru,
                
"chat_aciklama" => $req->getPost("aciklama")
            ]
        );
        if (!empty(
$req->getPost("cevap"))) {

            foreach (
$req->getPost("cevap") as $key => $value) {
                if (
$value != null) {
                    
db('chat')->insert([
                        
"chat_hash" => md5(uniqid() . rand() . time() . microtime() . uniqid()),
                        
"chat_ust" => $hash,
                        
"chat_cevap" => $value,
                        
"chat_ustSoru" => $ustSoru,
                        
"chat_aciklama" => $req->getPost("aciklama")
                    ]);
                }
            }
        }
        return 
redirect()->to('admin/chat-settings');
    }
    public function 
message()
    {
        if (
settings('chat_active') == 'false') {
            return 
redirect()->to('/admin');
        }
        
$messageHash $this->request->getPost('mesajHash');
        if (!isset(
$messageHash)) {
            die();
        }
        if (
$messageHash == 'buton') {

            
$hash md5(uniqid() . rand() . time() . microtime() . uniqid());
            
$sor db('chat')->where([
                
'chat_anaSoru' => '1'
            
])->get()->getResultArray();

            
$sora db('chat')->where([
                
'chat_hash' => $messageHash
            
])->get()->getResultArray();
?>

            <li class="self">
                <?php

                
foreach ($sor as $key => $anaSoru) {
                    echo 
preg_replace(
                        
'!(http|ftp|scp)(s)?:\/\/(.*)+!',
                        
"<a href=\"\\0\">\\0</a>",
                        
$anaSoru["chat_soru"]
                    );
                    
$alt db('chat')->where(array('chat_ustSoru' => $anaSoru["chat_hash"], "chat_ust !=" => "0"))->get()->getResultArray();
                    foreach (
$alt as $key => $value) {
                
?>
                        <button data-ust-hash="<?php echo $value["chat_hash"]; ?>" data-soru="<?php echo $value["chat_cevap"]; ?>" class="tpk-button mesaj-buton">
                            <?php echo preg_replace(
                                
'!(http|ftp|scp)(s)?:\/\/(.*)+!',
                                
"<a href=\"\\0\">\\0</a>",
                                
$value["chat_cevap"]
                            ); 
?>
                        </button>
                <?php
                    
}
                }

                
?>
            </li>
        <?php
        
} else {
            
$sor db('chat')->where([
                
'chat_ustSoru' => $messageHash,
                
"chat_ust !=" => "0"
            
])->get()->getResultArray();
            
$sora db('chat')->where([
                
'chat_ustSoru' => $messageHash,
            ])->
get()->getResultArray();
        
?>
            <li class="self">
                <?php
                
echo preg_replace(
                    
'!(http|ftp|scp)(s)?:\/\/(.*)+!',
                    
"<a href=\"\\0\">\\0</a>",
                    
$sora[0]["chat_aciklama"]
                );
                foreach (
$sor as $key => $value) {
                
?>
                    <button data-ust-hash="<?php echo $value["chat_hash"]; ?>" data-soru="<?php echo $value["chat_cevap"]; ?>" class="tpk-button mesaj-buton"><?php echo preg_replace(
                                                                                                                                                                    
'!(http|ftp|scp)(s)?:\/\/(.*)+!',
                                                                                                                                                                    
"<a href=\"\\0\">\\0</a>",
                                                                                                                                                                    
$value["chat_cevap"]
                                                                                                                                                                ); 
?></button>
                <?php
                
}
                
?>

            </li>
<?php

        
}
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.006 ]--