public static function get($param) { $config = array('language' => 'english', 'mobile_breakpoint' => 667, 'user_config_file' => getcwd() . '/config/config.json', 'use_database' => false, 'db_host' => 'localhost', 'db_username' => 'myUser', 'db_password' => 'myPassword', 'db_database' => 'myDatabase', 'repository' => getcwd() . '/repository', 'max_filesize' => 2097152, 'allow_signup' => false, 'signup_use_activation' => true, 'default_permissions_after_signup' => 'r', 'default_permissions_after_activation' => 'rwu', 'mail_from' => '*****@*****.**', 'mail_from_name' => 'info', 'mail_signature' => "\n\nBest Regards,\nThe Team", 'use_smtp_protocol' => false, 'mail_smtp_host' => 'smtp.example.com:587', 'mail_smtp_username' => '*****@*****.**', 'mail_smtp_password' => 'mypassword', 'mail_smtp_connection_security' => 'tls', 'mail_smtp_debug' => false, 'account_email_subject' => 'Action Required', 'account_email_text' => 'Please click on the link below to proceed to your account: ', 'allow_change_password' => true, 'enable_password_recovery' => false, 'allow_file_links' => true, 'direct_links_baseurl' => '', 'direct_links_basedir' => '', 'allow_email_links' => false, 'mail_link_subject' => 'File for you', 'use_googl_shorturl' => false, 'googl_shorturl_api_key' => '123456789', 'use_lightbox_gallery' => true, 'accept_file_extensions' => array('*'), 'max_files' => 100, 'time_format' => 'd/m/y', 'simple_copy_move' => true, 'use_zip' => true, 'allow_edit_files' => true, 'allow_rename_files' => true, 'show_top_auth_bar' => true, 'restricted_files' => array('.htaccess'), 'mask_repository_path' => false, 'encrypt_url_actions' => false, 'allow_guests' => false, 'use_auth' => true, 'base_url' => (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']), 'base_path' => getcwd(), 'write_log' => false); /** * * End of configuration options * */ $config['base_path'] = str_replace('\\', '/', $config['base_path']); if (class_exists('gator')) { $config = gator::validateConf($config, $param); } return $config[$param]; }
/** * * delete user */ static function deleteUser($username) { // // use database // if (gatorconf::get('use_database')) { $db = new DBDriver(); $username = $db->escape($username); $sql = "DELETE FROM users WHERE username = '******'"; return $db->execute($sql); } // // use user_config_file // $current_users = gator::getAllUsers(); foreach ($current_users as $key => $user) { if ($user['username'] == $username) { unset($current_users[$key]); $json_config = json_encode($current_users); file_put_contents(gatorconf::get('user_config_file'), $json_config, LOCK_EX); break; } } return; }
<div class="bottom-actions"> <?php if (gator::checkPermissions('rw')) { ?> <button type="button" class="nice radius button select-button"><?php echo lang::get("Select All"); ?> </button> <div class="selection-buttons"> <?php if (gatorconf::get('simple_copy_move')) { ?> <button type="button" class="nice secondary radius button simple-copy-selected"><?php echo lang::get("Copy"); ?> </button> <button type="button" class="nice secondary radius button simple-move-selected"><?php echo lang::get("Move"); ?> </button> <?php } else { ?> <button type="button" class="nice secondary radius button cut-selected"><?php echo lang::get("Cut"); ?> </button> <button type="button" class="nice secondary radius button copy-selected"><?php echo lang::get("Copy"); ?>
</td> </tr> <?php } ?> </tbody> </table> </div> <!-- end browse-panel --> </div> <div id="bottomcorners"></div> </div> </div> <div class="mobile-nav"> <div class="row"> <div class="container twelve columns"> <a href="?logout=1" class="mobile-actions sign-out"></a> </div> </div> </div> <div id="modal" class="reveal-modal"></div> <div id="second_modal" class="reveal-modal"></div> <div id="big_modal" class="reveal-modal large"></div> <?php gator::display("main_js.php");
?> </td> <td class="filetime"><?php echo date(gatorconf::get('time_format'), $file['time']); ?> </td> <?php if (gator::checkPermissions('r')) { ?> <td class="actions"> <button type="button" class="action-info" data-type="<?php echo $file['type']; ?> " data-link="<?php echo gator::encodeurl($file['link']); ?> " data-name="<?php echo $file['name']; ?> " data-crypt="<?php echo $file['crypt']; ?> " data-size="<?php echo $file['size']; ?> " data-time="<?php echo date(gatorconf::get('time_format'), $file['time']); ?> "></button> </td>
* * This Software is protected by copyright law and international treaties. This Software is licensed (not sold). * The unauthorized use, copying or distribution of this Software may result in severe criminal or civil penalties, * and will be prosecuted to the maximum extent allowed by law. * * DISCLAIMER OF WARRANTY: You acknowledge that this software is provided "AS IS" and may not be functional on * any machine or in any environment. Copyright owner have no obligation to correct any bugs, defects or errors, * to otherwise support the Software or otherwise assist you evaluate the Software. IN NO EVENT SHALL THE COPYRIGHT * OWNER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * */ define('VERSION', 'PRO v5.0'); error_reporting(NULL); // start session & handle logout session_start(); if (isset($_GET["logout"]) && $_GET["logout"] == 1) { session_destroy(); session_start(); } require_once "configuration.php"; if (gatorconf::get('use_database')) { require_once "./include/common/mysqli.php"; } require_once "./include/common/phpass.php"; require_once "./include/file-gator.php"; $app = new gator(); $app->init();