Advertisement
jamboljack

default.config filemanager

Nov 28th, 2016
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.18 KB | None | 0 0
  1. <?php
  2. /**
  3.  *  Filemanager PHP connector
  4.  *  This file should at least declare auth() function
  5.  *  and instantiate the Filemanager as '$fm'
  6.  *
  7.  *  IMPORTANT : by default Read and Write access is granted to everyone
  8.  *  Copy/paste this file to 'user.config.php' file to implement your own auth() function
  9.  *  to grant access to wanted users only
  10.  *
  11.  *  filemanager.php
  12.  *  use for ckeditor filemanager
  13.  *
  14.  *  @license    MIT License
  15.  *  @author     Simon Georget <simon (at) linea21 (dot) com>
  16.  *  @copyright  Authors
  17.  */
  18.  
  19. ob_start();
  20. include('../../../../index.php');
  21. ob_end_clean();
  22.  
  23. $CI =& get_instance();
  24. $CI->load->driver('session');
  25.  
  26. $session = @$_SESSION['logged_in_dagsar'];
  27.  
  28. if($session == TRUE) {
  29.     $codeigniterAuth = true;
  30. } else {
  31.     $codeigniterAuth = false;
  32. }
  33.  
  34. /**
  35.  *  Check if user is authorized
  36.  *
  37.  *
  38.  *  @return boolean true if access granted, false if no access
  39.  */
  40. function auth() {
  41.     // You can insert your own code over here to check if the user is authorized.
  42.     // If you use a session variable, you've got to start the session first (session_start())
  43.     return $GLOBALS['codeigniterAuth'];
  44. }
  45. // we instantiate the Filemanager
  46. $fm = new Filemanager();
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement