frontend/modules/elfind/controllers/DefaultController.php
/**
     * Renders the index view for the module
     * @return string
     */
Renders the index view for the module
@return string
Renders the index view for the module @return string
public function actionIndex()
    {
        if (Yii::$app->params['Stop_NodeApi_and_FM']) {
            return '{"error":["errNodeApiSuspended"]}';
        }
        $Maintenance = Maintenance::getMaintenance();
        if ($Maintenance->maintenance_suspend_fm) {
            return '{"error":["errNodeApiSuspended"]}';
        }
        if (!Yii::$app->user->isGuest) {
            $User = Users::getPathNodeFS(Yii::$app->user->identity->getId());
            if ($User) {
                $User->user_last_ip = Yii::$app->request->getUserIP();
                $User->save();
                NodeApi::generate_site_token();
                $opts = array(
                    'roots' => array(
                        array(
                            'driver' => 'LocalFileSystem',           
                            'path' => $User->_full_path,        
                            'uploadAllow' => array('all'),                
                            'uploadMaxSize' => '0',
                            //'uploadDeny'    => array('all'),                
                            'uploadOrder' => array('deny', 'allow'),      
                            'accessControl' => 'access'                     
                        )
                    )
                );
                require_once(__DIR__ . '/../src/connector.php');
            }
        }
    }
public function actionIndex ( ) { if ( Yii :: $ app -> params [ 'Stop_NodeApi_and_FM' ] ) { return '{"error":["errNodeApiSuspended"]}' ; } $ Maintenance = Maintenance :: getMaintenance ( ) ; if ( $ Maintenance -> maintenance_suspend_fm ) { return '{"error":["errNodeApiSuspended"]}' ; } if ( ! Yii :: $ app -> user -> isGuest ) { $ User = Users :: getPathNodeFS ( Yii :: $ app -> user -> identity -> getId ( ) ) ; if ( $ User ) { $ User -> user_last_ip = Yii :: $ app -> request -> getUserIP ( ) ; $ User -> save ( ) ; NodeApi :: generate_site_token ( ) ; $ opts = array ( 'roots' => array ( array ( 'driver' => 'LocalFileSystem' , 'path' => $ User -> _full_path , 'uploadAllow' => array ( 'all' ) , 'uploadMaxSize' => '0' , 'uploadOrder' => array ( 'deny' , 'allow' ) , 'accessControl' => 'access' ) ) ) ; require_once ( __DIR__ . '/../src/connector.php' ) ; } } }
Renders the index view for the module
 @return string
Renders the index view for the module @return string
// если система на обслуживании // если система на обслуживании //sleep(5); //var_dump($User); exit; //Yii::$app->session->open(); //var_dump(NodeApi::site_token_key()); exit; //'debug' => true, // driver for accessing file system (REQUIRED) // path to files (REQUIRED) //'URL'           => dirname($_SERVER['PHP_SELF']) . '/../files/', // URL to files (REQUIRED) // All Mimetypes not allowed to upload //'uploadDeny'    => array('all'),                // All Mimetypes not allowed to upload //'uploadAllow'   => array('image', 'text/plain'),// Mimetype image and text/plain allowed to upload // allowed Mimetype image and text/plain only // disable and hide dot starting files (OPTIONAL)