REDROOM
PHP 8.1.33
Path:
Logout
Edit File
Size: 2.88 KB
Close
/home/jambtst2015/public_html/protected/components/Controlleradmin.php
Text
Base64
<?php /** * Controller is the customized base controller class. * All controller classes for this application should extend from this base class. */ class Controlleradmin extends CController { /** * @var string the default layout for the controller view. Defaults to '//layouts/column1', * meaning using a single column layout. See 'protected/views/layouts/column1.php'. */ public $layout='//layouts/column1'; /** * @var array context menu items. This property will be assigned to {@link CMenu::items}. */ public $menu=array(); /** * @var array the breadcrumbs of the current page. The value of this property will * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links} * for more details on how to specify this property. */ public $breadcrumbs=array(); var $fields; /** columns names retrieved after parsing */ var $separator = ','; /** separator used to explode each line */ var $enclosure = '"'; /** enclosure used to decorate each field */ var $max_row_size = 4096; /** maximum row size to be used for decoding */ public function beforeAction($e){ $isAdmin = Yii::app()->user->getState("isAdmin"); $action = $this->action->Id; if($isAdmin=='' && $action!='login'){ $this->redirect(Yii::app()->user->returnUrl.'webadmin/login'); return false; }elseif($isAdmin!='' && $action=='login'){ $this->redirect(Yii::app()->user->returnUrl.'webadmin/'); return true; }else{ return true; } } /** * This is the import csv file data */ public function parse_file($p_Filepath, $p_NamedFields = true) { $content = false; $file = fopen($p_Filepath, 'r'); if($p_NamedFields) { $this->fields = fgetcsv($file, $this->max_row_size, $this->separator, $this->enclosure); } while( ($row = fgetcsv($file, $this->max_row_size, $this->separator, $this->enclosure)) != false ) { if( $row[0] != null ) { // skip empty lines if( !$content ) { $content = array(); } if( $p_NamedFields ) { $items = array(); $value = ''; //print_r($this->fields); // I prefer to fill the array with values of defined fields foreach( $this->fields as $id => $field ) { if( isset($row[$id]) ) { //$field = str_replace(" ","_",strtolower($field)); $field = trim(strtolower($field)); $field = str_replace(" ","_",$field); $value = trim($row[$id]); //$items[$field] = trim($row[$id]); $items[$field] = $value; } } $content[] = $items; } else { $content[] = $row; } } } fclose($file); return $content; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 12
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
AdminIdentity.php
2.16 KB
lrw-r--r--
2024-11-22 17:53:11
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Controller.php
1.32 KB
lrw-r--r--
2024-11-22 17:53:11
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Controlleradmin.php
2.88 KB
lrw-r--r--
2024-11-22 17:53:11
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Controlleradmin_bk_06_10_2014.php
2.96 KB
lrw-r--r--
2024-11-22 17:53:11
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Controlleruser.php
2.63 KB
lrw-r--r--
2024-11-22 17:53:11
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Controlleruser_bk_23_09_2014.php
2.43 KB
lrw-r--r--
2024-11-22 17:53:11
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
error_log
42.64 KB
lrw-r--r--
2025-11-04 10:28:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Helpers.php
8.77 KB
lrw-r--r--
2024-11-22 17:53:11
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Helpers_bk_23_9_2014.php
8.17 KB
lrw-r--r--
2024-11-22 17:53:11
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
UserIdentity.php
1.61 KB
lrw-r--r--
2024-11-22 17:53:11
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
UserpinIdentity.php
1.61 KB
lrw-r--r--
2024-11-22 17:53:11
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
UserpinIdentity_bk.php
2.27 KB
lrw-r--r--
2024-11-22 17:53:11
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).