AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.108
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/wwwroot/mifepriston.org/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /www/wwwroot/mifepriston.org/controllers/SiteController.php
<?php

namespace app\controllers;

use Yii;
use yii\filters\AccessControl;
use yii\web\Controller;
use yii\web\Response;
use yii\filters\VerbFilter;
use app\models\LoginForm;
use app\models\ContactForm;
use app\models\ProductDetails;
use app\models\Page;
use yii\web\Session;

class SiteController extends Controller
{
    /**
     * @var ProductDetails Model for the table product_details
     */
    public $model;

    /**
     * {@inheritdoc}
     */
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'only' => ['logout'],
                'rules' => [
                    [
                        'actions' => ['logout'],
                        'allow' => true,
                        'roles' => ['@'],
                    ],
                ],
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'logout' => ['post'],
                ],
            ],
            // 'caching' => [
            //     'class' => 'yii\filters\PageCache',
            //     'only' => ['index'],
            //     'duration' => 3600 * 24 * 365,
            //     'variations' => [
            //         Yii::$app->language,
            //     ],
            //     'dependency' => [
            //         'class' => 'yii\caching\DbDependency',
            //         'sql' => 'SELECT MAX(modified_at) FROM pages',
            //     ],
            // ],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function beforeAction($action)
    {
        $this->layout = '@app/views/layouts/front';
        $lang = Yii::$app->request->get('lang');
        if (in_array($lang, array_keys(Yii::$app->params['languages']))) Yii::$app->language = $lang;
        else $lang = Yii::$app->language;
        $this->model = ProductDetails::find()
            ->where('product_id = :product_id and lang = :lang', ['product_id' => Yii::$app->params['productId'], ':lang' => $lang])
            ->one();
        return parent::beforeAction($action);
    }

    /**
     * {@inheritdoc}
     */
    public function actions()
    {
        return [
            'privacy' => ['class' => 'app\components\PageAction'],
            'error' => ['class' => 'yii\web\ErrorAction'],
        ];
    }

    /**
     * Home page
     */
    public function actionIndex()
    {
        return $this->render('index', [
            'h1' => $this->model->h1,
            'description' => Page::find()->select('text')->where('lang = :lang and action = :action', [':lang' => Yii::$app->language, ':action' => 'description'])->one(),
            'indications' => Page::find()->select('text')->where('lang = :lang and action = :action', [':lang' => Yii::$app->language, ':action' => 'indications'])->one(),
            'manual' => Page::find()->select('text')->where('lang = :lang and action = :action', [':lang' => Yii::$app->language, ':action' => 'manual'])->one(),
            'advantages' => Page::find()->select('text')->where('lang = :lang and action = :action', [':lang' => Yii::$app->language, ':action' => 'advantages'])->one(),
            'reviews' => Page::find()->select('text')->where('lang = :lang and action = :action', [':lang' => Yii::$app->language, ':action' => 'reviews'])->one(),
        ]);
    }

    /**
     * Login action.
     *
     * @return Response|string
     */
    public function actionLogin()
    {
        if (!Yii::$app->user->isGuest) {
            return $this->goHome();
        }

        $model = new LoginForm();
        if ($model->load(Yii::$app->request->post()) && $model->login()) {
            return $this->goBack();
        }

        $model->password = '';
        return $this->render('login', [
            'model' => $model,
        ]);
    }


    public function actionMas(){
    	$session = Yii::$app->session;
    	foreach ($session as $session_name => $session_value){
    			echo $session_name.' - '.$session_value;
    	}
    
    }
    /**
     * Logout action.
     *
     * @return Response
     */
    public function actionLogout()
    {
        Yii::$app->user->logout();

        return $this->goHome();
    }

    /**
     * Displays contact page.
     *
     * @return Response|string
     */
    public function actionContact()
    {
        $model = new ContactForm();
        if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
            Yii::$app->session->setFlash('contactFormSubmitted');

            return $this->refresh();
        }
        return $this->render('contact', [
            'model' => $model,
        ]);
    }
}

Anon7 - 2022
AnonSec Team