REDROOM
PHP 8.1.33
Path:
Logout
Edit File
Size: 2.66 KB
Close
/home/jambtst2015/public_html/eschoolengine Installer/application/controllers/Updater.php
Text
Base64
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); /* * @author : Joyonto Roy * date : 27 september, 2014 * eschool School Management System Pro * http://codecanyon.net/user/Creativeitem * support@creativeitem.com */ class Updater extends CI_Controller { function __construct() { parent::__construct(); $this->load->database(); $this->load->library('session'); /*cache control*/ $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); $this->output->set_header('Pragma: no-cache'); } /***default functin, redirects to login page if no admin logged in yet***/ public function index() { if ($this->session->userdata('admin_login') != 1) redirect(base_url() . 'index.php?login', 'refresh'); if ($this->session->userdata('admin_login') == 1) redirect(base_url() . 'index.php?admin/dashboard', 'refresh'); } /***** UPDATE PRODUCT *****/ function update($task = '', $purchase_code = '') { if ($this->session->userdata('admin_login') != 1) redirect(base_url(), 'refresh'); // Create update directory. $dir = 'update'; if (!is_dir($dir)) mkdir($dir, 0777, true); $zipped_file_name = $_FILES["file_name"]["name"]; $path = 'update/' . $zipped_file_name; move_uploaded_file($_FILES["file_name"]["tmp_name"], $path); // Unzip uploaded update file and remove zip file. $zip = new ZipArchive; $res = $zip->open($path); if ($res === TRUE) { $zip->extractTo('update'); $zip->close(); unlink($path); } $unzipped_file_name = substr($zipped_file_name, 0, -4); $str = file_get_contents('./update/' . $unzipped_file_name . '/update_config.json'); $json = json_decode($str, true); // Run php modifications require './update/' . $unzipped_file_name . '/update_script.php'; // Create new directories. if (!empty($json['directory'])) { foreach ($json['directory'] as $directory) { if (!is_dir($directory['name'])) mkdir($directory['name'], 0777, true); } } // Create/Replace new files. if (!empty($json['files'])) { foreach ($json['files'] as $file) copy($file['root_directory'], $file['update_directory']); } $this->session->set_flashdata('flash_message', get_phrase('product_updated_successfully')); redirect(base_url() . 'index.php?admin/system_settings'); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 13
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
.DS_Store
6.00 KB
lrwxrwxrwx
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Admin.php
94.87 KB
lrwxrwxrwx
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.html
131 B
lrwxrwxrwx
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Install.php
484 B
lrwxrwxrwx
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Login.php
7.09 KB
lrwxrwxrwx
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Mobile.php
29.60 KB
lrwxrwxrwx
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Modal.php
1.08 KB
lrwxrwxrwx
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Multilanguage.php
967 B
lrwxrwxrwx
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Parents.php
15.58 KB
lrwxrwxrwx
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Simplexlsx.class.php
18.88 KB
lrwxrwxrwx
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Student.php
18.17 KB
lrwxrwxrwx
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Teacher.php
32.89 KB
lrwxrwxrwx
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Updater.php
2.66 KB
lrwxrwxrwx
2024-11-22 17:53:15
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).