Compare commits

...

9 Commits

Author SHA1 Message Date
Deon George
0941331781 Updated for new Gitlab 2015-09-29 16:48:35 +10:00
Deon George
7cd2251af3 Moved KH LDAP functions into KH module 2013-07-12 13:48:14 +10:00
Deon George
6fcc09f437 Local config 2013-06-25 16:47:42 +10:00
Deon George
15bd1fbb6e Basic layout and login functioning 2013-06-25 13:46:39 +10:00
Deon George
7e2cdac7e9 Basic layout and login functioning 2013-06-25 13:18:36 +10:00
Deon George
808766bb87 Initial application work 2013-06-25 13:18:27 +10:00
Deon George
cfd7b5db83 Added KH 3.3.0 2013-06-24 21:36:06 +10:00
Deon George
715f7efe9b Version Change 2013-03-19 15:55:32 +11:00
Nic Bernstein
5ba2cf67e9 SF Bug #1008 getContainerPath doesn't properly traverse to baseDN and back & #1009 - return_ldap_hash should not return container object in result set 2013-03-19 15:55:32 +11:00
32 changed files with 974 additions and 19 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
config/config.php
queries/custom_*
templates/*/custom_*
devel

9
.gitmodules vendored Normal file
View File

@ -0,0 +1,9 @@
[submodule "includes/kohana"]
path = includes/kohana
url = git@dev.leenooks.net:deon/lnkohana.git
[submodule "modules/ldap"]
path = modules/ldap
url = git@dev.leenooks.net:deon/lnldap.git
[submodule "modules/lnapp"]
path = modules/lnapp
url = git@dev.leenooks.net:deon/lnapp.git

21
.htaccess Normal file
View File

@ -0,0 +1,21 @@
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /pla
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
</Files>
# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|includes/kohana)\b.* index.php/$0 [L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]

View File

@ -1 +1 @@
RELEASE-1.2.3
DEVEL-2.0

151
application/bootstrap.php Normal file
View File

@ -0,0 +1,151 @@
<?php defined('SYSPATH') or die('No direct script access.');
// -- Environment setup --------------------------------------------------------
// Load the core Kohana class
require SYSPATH.'classes/Kohana/Core'.EXT;
if (is_file(APPPATH.'classes/Kohana'.EXT))
{
// Application extends the core
require APPPATH.'classes/Kohana'.EXT;
}
else
{
// Load empty core extension
require SYSPATH.'classes/Kohana'.EXT;
}
/**
* Set the default time zone.
*
* @link http://kohanaframework.org/guide/using.configuration
* @link http://www.php.net/manual/timezones
*/
date_default_timezone_set('Australia/Melbourne');
/**
* Set the default locale.
*
* @link http://kohanaframework.org/guide/using.configuration
* @link http://www.php.net/manual/function.setlocale
*/
setlocale(LC_ALL, 'en_US.utf-8');
/**
* Enable the Kohana auto-loader.
*
* @link http://kohanaframework.org/guide/using.autoloading
* @link http://www.php.net/manual/function.spl-autoload-register
*/
spl_autoload_register(array('Kohana', 'auto_load'));
/**
* Optionally, you can enable a compatibility auto-loader for use with
* older modules that have not been updated for PSR-0.
*
* It is recommended to not enable this unless absolutely necessary.
*/
//spl_autoload_register(array('Kohana', 'auto_load_lowercase'));
/**
* Enable the Kohana auto-loader for unserialization.
*
* @link http://www.php.net/manual/function.spl-autoload-call
* @link http://www.php.net/manual/var.configuration#unserialize-callback-func
*/
ini_set('unserialize_callback_func', 'spl_autoload_call');
// -- Configuration and initialization -----------------------------------------
/**
* Set the default language
*/
I18n::lang('en-us');
/**
* Set Kohana::$environment if a 'KOHANA_ENV' environment variable has been supplied.
*
* Note: If you supply an invalid environment name, a PHP warning will be thrown
* saying "Couldn't find constant Kohana::<INVALID_ENV_NAME>"
*/
if (isset($_SERVER['KOHANA_ENV']))
{
Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV']));
}
/**
* Initialize Kohana, setting the default options.
*
* The following options are available:
*
* - string base_url path, and optionally domain, of your application NULL
* - string index_file name of your index file, usually "index.php" index.php
* - string charset internal character set used for input and output utf-8
* - string cache_dir set the internal cache directory APPPATH/cache
* - integer cache_life lifetime, in seconds, of items cached 60
* - boolean errors enable or disable error handling TRUE
* - boolean profile enable or disable internal profiling TRUE
* - boolean caching enable or disable internal caching FALSE
* - boolean expose set the X-Powered-By header FALSE
*/
Kohana::init(array(
'base_url' => '/pla',
'caching' => TRUE,
'index_file' => '',
));
/**
* Attach the file write to logging. Multiple writers are supported.
*/
Kohana::$log->attach(new Log_File(APPPATH.'logs'));
/**
* Attach a file reader to config. Multiple readers are supported.
*/
Kohana::$config->attach(new Config_File);
/**
* Enable modules. Modules are referenced by a relative or absolute path.
*/
Kohana::modules(array(
'lnapp' => MODPATH.'lnApp',
'auth' => SMDPATH.'auth', // Basic authentication
'cache' => SMDPATH.'cache', // Caching with multiple backends
// 'codebench' => SMDPATH.'codebench', // Benchmarking tool
'ldap' => MODPATH.'ldap', // LDAP Database Interaction (Depends on DATABASE which must be after this)
'database' => SMDPATH.'database', // Database access
// 'image' => SMDPATH.'image', // Image manipulation
'minion' => SMDPATH.'minion', // CLI Tasks
'orm' => SMDPATH.'orm', // Object Relationship Mapping
// 'pagination' => SMDPATH.'pagination', // Kohana Pagination module for Kohana 3 PHP Framework
// 'unittest' => SMDPATH.'unittest', // Unit testing
'userguide' => SMDPATH.'userguide', // User guide and API documentation
'xml' => SMDPATH.'xml', // XML module for Kohana 3 PHP Framework
));
// Static file serving (CSS, JS, images)
Route::set('default/media', 'media(/<file>)', array('file' => '.+'))
->defaults(array(
'controller' => 'media',
'action' => 'get',
));
/**
* Set the routes. Each route must have a minimum of a name, a URI and a set of
* defaults for the URI.
*/
Route::set('default', '(<controller>(/<action>(/<id>)))', array('id'=>'[a-zA-Z0-9_.-]+'))
->defaults(array(
'controller' => 'welcome',
'action' => 'index',
));
/**
* If APC is enabled, and we need to clear the cache
*/
if (file_exists(APPPATH.'cache/CLEAR_APC_CACHE') AND function_exists('apc_clear_cache') AND (PHP_SAPI !== 'cli')) {
if (! apc_clear_cache() OR ! unlink(APPPATH.'cache/CLEAR_APC_CACHE'))
throw new Kohana_Exception('Unable to clear the APC cache.');
}
?>

View File

@ -0,0 +1,106 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class extends the core Kohana class by adding some core application
* specific functions, and configuration.
*
* @package PLA
* @category Helpers
* @author Deon George
* @copyright (c) phpLDAPadmin Development Team
* @license http://dev.phpldapadmin.org/license.html
*/
class Config extends Kohana_Config {
// Our default logo, if there is no site logo
public static $logo = 'img/logo-small.png';
/**
* Some early initialisation
*
* At this point, KH hasnt been fully initialised either, so we cant rely on
* too many KH functions yet.
*
* NOTE: Kohana doesnt provide a parent construct for the Kohana_Config class.
*/
public function __construct() {
}
/**
* Get the singleton instance of Config.
*
* $config = Config::instance();
*
* @return Config
* @compat Restore KH 3.1 functionality
*/
public static function instance() {
if (Config::$_instance === NULL)
// Create a new instance
Config::$_instance = new Config;
return Config::$_instance;
}
/**
* Return our caching mechanism
*/
public static function cachetype() {
return is_null(Kohana::$config->load('config')->cache_type) ? 'file' : Kohana::$config->load('config')->cache_type;
}
public static function copywrite() {
return '(c) phpLDAPadmin Development Team';
}
public static function country() {
return NULL;
}
public static function language() {
// @todo To implement
return 'auto';
}
/**
* The URI to show for the login prompt.
* Normally if the user is logged in, we can replace it with something else
*/
public static function login_uri() {
return ($ao = Auth::instance()->get_user() AND is_object($ao)) ? $ao->name() : HTML::anchor('login',_('Login'));
}
public static function logo() {
return HTML::image(static::logo_uri(),array('class'=>'headlogo','alt'=>_('Logo')));
}
public static function logo_uri($protocol=NULL) {
list ($path,$suffix) = explode('.',static::$logo);
return URL::site(Route::get('default/media')->uri(array('file'=>$path.'.'.$suffix),array('alt'=>static::sitename())),$protocol);
}
public static function siteid($format=FALSE) {
return '';
}
/**
* Work out our site mode (dev,test,prod)
*/
public static function sitemode() {
return Kohana::$config->load('config.site')->mode;
}
public static function sitename() {
return 'phpLDAPadmin';
}
public static function theme() {
return 'theme/'.Kohana::$config->load('config')->theme;
}
public static function version() {
// @todo Work out our versioning
return 'TBA';
}
}
?>

View File

@ -0,0 +1,4 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
class Controller_Template extends PLA_Controller_Template {}
?>

View File

@ -0,0 +1,46 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides the default template controller for rendering pages.
*
* @package OSB
* @category Controllers
* @author Deon George
* @copyright (c) phpLDAPadmin Development Team
* @license http://dev.phpldapadmin.org/license.html
*/
class Controller_TemplateDefault extends lnApp_Controller_TemplateDefault {
public function __construct(Request $request, Response $response) {
if (Config::theme())
$this->template = Config::theme().'/page';
return parent::__construct($request,$response);
}
protected function _headimages() {
// This is where we should be able to change our country
// @todo To implement
$co = Config::country();
/*
HeadImages::add(array(
'img'=>sprintf('img/country/%s.png',strtolower($co->two_code)),
'attrs'=>array('onclick'=>"target='_blank';",'title'=>$co->display('name'))
));
*/
return HeadImages::factory();
}
protected function _left() {
if ($this->template->left)
return $this->template->left;
elseif (Auth::instance()->logged_in(NULL,get_class($this).'|'.__METHOD__))
return Controller_Tree::js();
}
protected function _right() {
return empty($this->template->right) ? '' : $this->template->right;
}
}
?>

View File

@ -0,0 +1,15 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class overrides Kohana's Cookie
*
* @package PLA/Modifications
* @category Helpers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.phpldapadmin.org/license.html
*/
class Cookie extends Kohana_Cookie {
public static $salt = 'PLA';
}
?>

View File

@ -0,0 +1,116 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides the default template controller for rendering pages.
*
* @package PLA
* @category Controllers
* @author Deon George
* @copyright (c) phpLDAPadmin Development Team
* @license http://dev.phpldapadmin.org/license.html
*/
abstract class PLA_Controller_Template extends Kohana_Controller_Template {
// @var object meta object information as per [meta]
private $meta;
public function __construct(Request $request, Response $response) {
$this->template = Config::theme().'/page';
return parent::__construct($request,$response);
}
public function before() {
// Do not template media files
if ($this->request->action() === 'media') {
$this->auto_render = FALSE;
return;
}
parent::before();
// For AJAX calls, we dont need to render the complete page.
if ($this->request->is_ajax()) {
$this->auto_render = FALSE;
return;
}
$this->template->content = '';
// Setup the page template
$this->meta = new Meta;
View::bind_global('meta',$this->meta);
}
public function after() {
if ($this->auto_render === TRUE) {
// Application Title
$this->meta->title = Kohana::$config->load('config')->appname;
// Language
// @todo
$this->meta->language = '';
// Description
$this->meta->description = sprintf('%s::%s',$this->request->controller(),$this->request->action());
// Control Line
// @todo
$this->template->control = '';
// System Messages line
// @todo
$this->template->sysmsg = '';
// Left Item
// @todo
$this->template->left = '';
$this->template->right = '';
$this->template->center = '';
if (! $this->response->body())
$this->response->body((string)Block::factory());
if (empty($this->template->content))
$this->template->content = $this->response->body();
// Footer
// @todo
$this->template->footer = '';
// Our default script(s)
foreach (array('file'=>array_reverse(array(
))) as $type => $datas) {
foreach ($datas as $data) {
Script::add(array(
'type'=>$type,
'data'=>$data,
),TRUE);
}
}
// For any ajax rendered actions, we'll need to capture the content and put it in the response
// @todo
} elseif ($this->request->is_ajax() && isset($this->template->content) && ! $this->response->body()) {
// @todo move this formatting to a view?
if ($s = $this->_sysmsg() AND (string)$s)
$this->response->body(sprintf('<table class="sysmsg"><tr><td>%s</td></tr></table>',$s));
// Since we are ajax, we should re-render the breadcrumb
Session::instance()->set('breadcrumb',(string)Breadcrumb::factory());
$this->response->bodyadd(Script::add(array('type'=>'stdin','data'=>'$().ready($("#ajCONTROL").load("'.URL::site('welcome/breadcrumb').'",null,function(x,s,r) {}));')));
// In case there any javascript for this render.
$this->response->bodyadd(Script::factory());
// Get the response body
$this->response->bodyadd(sprintf('<table class="content"><tr><td>%s</td></tr></table>',$this->template->content));
}
parent::after();
// Generate and check the ETag for this file
if (Kohana::$environment === Kohana::PRODUCTION)
$this->response->check_cache(NULL,$this->request);
}
}

View File

@ -0,0 +1,31 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class extends the core Kohana exception handling
*
* @package PLA
* @category Exceptions
* @author Deon George
* @copyright (c) phpLDAPadmin Development Team
* @license http://dev.phpldapadmin.org/license.html
*/
class PLA_Exception extends Kohana_Exception {
public function __construct($message, array $variables = NULL, $code = 0) {
parent::__construct($message,$variables,$code);
switch ($code) {
case '400':
SystemMessage::add('warn',$message);
Request::current()->redirect('login');
break;
}
echo debug::vars(array('m'=>$message,'v'=>$variables,'c'=>$code,'t'=>$this));die();
}
public function __toString() {
echo __METHOD__;die();
}
}
?>

View File

@ -0,0 +1,51 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class overrides Kohana's URL
*
* @package OSB/Modifications
* @category Classes
* @category Helpers
* @author Deon George
* @copyright (c) phpLDAPadmin Development Team
* @license http://dev.phpldapadmin.org/license.html
*/
class URL extends Kohana_URL {
// Our method paths for different functions
public static $method_directory = array(
'user'=>'',
);
/**
* Wrapper to provide a URL::site() link based on function
*/
public static function link($dir,$src,$site=FALSE) {
if (! $dir)
return $src;
if (! array_key_exists($dir,URL::$method_directory))
throw new Kohana_Exception('Unknown directory :dir for :src',array(':dir'=>$dir,':src'=>$src));
$x = URL::$method_directory[$dir].'/'.$src;
return $site ? URL::site($x) : $x;
}
/**
* Function to reveal the real directory for a URL
*/
public static function dir($dir) {
// Quick check if we can do something here
if (! in_array(strtolower($dir),URL::$method_directory))
return $dir;
// OK, we can, find it.
foreach (URL::$method_directory as $k=>$v)
if (strtolower($dir) == $v)
return ucfirst($k);
// If we get here, we didnt have anything.
return $dir;
}
}
?>

View File

@ -0,0 +1,22 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* OSB authentication configuration
*
* @package PLA
* @category Configuration
* @author Deon George
* @copyright (c) phpLDAPadmin Development Team
* @license http://dev.phpldapadmin.org/license.html
*/
return array(
'driver' => 'LDAP',
// 'hash_method' => '',
'hash_key' => '', // LDAP passwords should be cleartext
'lifetime' => 1209600,
// 'session_key' => 'auth_user',
// 'forced_key' => 'auth_forced',
'pwreset' => FALSE,
);
?>

View File

@ -0,0 +1,22 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* PLA Configuration - System Default Configurable Items.
*
* @package PLA
* @category Configuration
* @author Deon George
* @copyright (c) phpLDAPadmin Development Team
* @license http://dev.phpldapadmin.org/license.html
*/
return array(
'appname' => 'phpLDAPadmin - LDAP Administration', // Our application name, as shown in the title bar of pages
'method_security' => FALSE, // Enables Method Security. Setting to false means any method can be run without authentication
// Our mode level (PRODUCTION, STAGING, TESTING, DEVELOPMENT) - see [Kohana]
'mode' => Kohana::PRODUCTION,
// Our custom theme
'loginpage' => 'welcome',
'theme' => 'bootstrap',
);
?>

View File

@ -0,0 +1,23 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* PLA Configuration - Debug Settings
*
* @package PLA
* @category Configuration
* @author Deon George
* @copyright (c) 2013 phpLDAPadmin Development Team
* @license http://dev.phpldapadmin.org/license.html
*/
return array
(
'ajax'=>FALSE, // AJAX actions can only be run by ajax calls if set to FALSE
'etag'=>FALSE, // Force generating ETAGS
'checkout_notify'=>FALSE, // Test mode to test a particular checkout_notify item
'invoice'=>0, // Number of invoices to generate in a pass
'site'=>FALSE, // Glogal site debug
'show_inactive'=>FALSE, // Show Inactive Items
'task_sim'=>FALSE, // Simulate running tasks
);
?>

View File

@ -0,0 +1,23 @@
<?php defined('SYSPATH') or die('No direct script access.');
return array(
// Leave this alone
'modules' => array(
// This should be the path to this modules userguide pages, without the 'guide/'. Ex: '/guide/modulename/' would be 'modulename'
'pla' => array(
// Whether this modules userguide pages should be shown
'enabled' => TRUE,
// The name that should show up on the userguide index page
'name' => 'phpLDAPadmin',
// A short description of this module, shown on the index page
'description' => 'phpLDAPadmin API guide.',
// Copyright message, shown in the footer for this module
'copyright' => '&copy; 20082010 phpLDAPadmin Developer Team',
)
)
);

View File

Before

Width:  |  Height:  |  Size: 902 B

After

Width:  |  Height:  |  Size: 902 B

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -0,0 +1 @@
This hasnt been implemented yet!

View File

Before

Width:  |  Height:  |  Size: 519 B

After

Width:  |  Height:  |  Size: 519 B

View File

Before

Width:  |  Height:  |  Size: 654 B

After

Width:  |  Height:  |  Size: 654 B

View File

@ -0,0 +1,95 @@
html, body {
height: 100%;
margin: 0;
overflow: hidden;
padding: 0;
}
.claro #appLayout {
height: 100%;
}
.claro #appHeader {
border: 0px;
padding-bottom: 0px;
}
.claro #appControl {
border-top: 1px #AAAACC solid;
border-bottom: 0;
border-left: 0;
border-right: 0;
padding-top: 5px;
padding-bottom: 0;
}
.claro #appLeft {
border: 1px #AAAACC solid;
width: 14em;
}
.claro #appBody {
border: 1px #AAAACC solid;
padding: 0;
}
.claro #appStatus {
display: none;
}
.claro #appContent {
border: 0;
padding: 0;
}
.claro #appFooter {
border-top: 1px #AAAACC solid;
border-bottom: 0;
border-left: 0;
border-right: 0;
padding-top: 3px;
padding-bottom: 1px;
}
.claro .headlogo {
border: 0px;
}
.claro .foottext {
text-align: right;
font-size: 75%;
font-weight: bold;
}
/* Login Box */
.claro table.login {
background-color: #FAFAFF;
border: 1px #AAAACC solid;
padding: 5px;
margin-left: auto;
margin-right: auto;
}
.claro table.login .username {
background: url('image/ldap-uid.png') no-repeat 0 1px;
background-color: #FAFAFF;
color: #500000;
padding-left: 17px;
}
.claro table.login .username:focus {
background-color: #F0F0FF;
color: #000000;
}
.claro table.login .username:disabled {
background-color: #DDDDFF;
color: #000000;
}
.claro table.login .password {
background: url('image/key.png') no-repeat 0 1px;
background-color: #FAFAFF;
color: #000000;
padding-left: 17px;
}
.claro table.login .password:focus {
background-color: #F0F0FF;
color: #000000;
}
.claro table.login .password:disabled {
background-color: #DDDDFF;
color: #000000;
}

View File

@ -0,0 +1,83 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- DOJO claro Template Layout -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="auto" lang="auto">
<head>
<title><?php echo $meta->title; ?></title>
<link rel="shortcut icon" href="<?php echo $meta->shortcut_icon ? $meta->shortcut_icon : URL::Site('media/img/favicon.ico'); ?>" type="image/vnd.microsoft.icon" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="<?php echo $meta->language; ?>" />
<meta name="keywords" content="<?php echo $meta->keywords; ?>" />
<meta name="description" content="<?php echo $meta->description; ?>" />
<meta name="copyright" content="<?php echo Config::copywrite(); ?>" />
<!-- Load dojo and provide config via data attribute -->
<?php echo HTML::Style('media/js/dojo-release-1.7.2/dijit/themes/claro/claro.css',array('media'=>'screen')); ?>
<?php echo HTML::Script('media/js/dojo-release-1.7.2/dojo/dojo.js',array('data-dojo-config'=>'async: true, parseOnLoad: true')); ?>
<?php echo HTML::Style('media/theme/claro/css/style.css',array('media'=>'screen')); ?>
<script>
require(["dijit/layout/BorderContainer","dijit/layout/TabContainer","dijit/layout/ContentPane","dijit/Dialog","dijit/MenuBar","dijit/MenuBarItem"]);
require(["dojo/data/ItemFileWriteStore","dijit/Tree"]);
</script>
<!-- Other Style sheets or scripts that are used -->
<?php echo Style::factory(); ?>
<?php echo Script::factory(); ?>
<!-- testing -->
<script type="text/javascript">
require(["dojo/ready"], function() {
dojo.addOnLoad(function() {
var store = new dojo.data.ItemFileWriteStore({
url: "/pla/media/demo1.json"
});
var model = new dijit.tree.TreeStoreModel({
store: store,
childrenAttrs: ["children"]
});
new dijit.Tree({
model: model,
}, "ldaptree");
});
});
</script>
</head>
<body class="claro">
<div id="appLayout" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design: 'headline'">
<div id="appHeader" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'top'">
<?php echo Config::logo(); ?>
</div>
<div id="appControl" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'top'">
<div dojoType="dijit.MenuBar" id="navMenu">
<div dojoType="dijit.MenuBarItem" onClick="window.location='<?php echo URL::site('login'); ?>'">
<span>Login</span>
</div>
<div dojoType="dijit.MenuBarItem" onClick="dijit.byId('helpDialog').show();">
<span>Help</span>
</div>
</div>
<div data-dojo-type="dijit.Dialog" id="helpDialog" data-dojo-props="title: '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Help &amp;amp; Support'" href="<?php echo URL::Site('media/notimplemented.txt'); ?>"></div>
</div>
<?php if (Auth::instance()->logged_in()) { ?>
<div id="appLeft" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'left', splitter: true">
<div id="ldaptree"></div>
</div>
<div id="appBody" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'center'">
<div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design: 'headline'">
<div id="appStatus" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'top'"></div>
<div id="appContent" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'center'">
<div data-dojo-type="dijit.layout.TabContainer" data-dojo-props="">
<?php echo $content; ?>
</div>
</div>
</div>
</div>
<?php } else { ?>
<div id="appBody" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'center'">
<?php echo $content; ?>
</div>
<?php } ?>
<div id="appFooter" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'">
<div class="foottext"><?php echo Config::version(); ?></div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,3 @@
<div data-dojo-type="dijit.layout.ContentPane" title="<?php echo $title ?>">
<?php echo $body; ?>
</div>

View File

@ -0,0 +1,14 @@
<?php echo Form::open(); ?>
<table class="login">
<tr><td><b>User Name:</b></td></tr>
<tr><td><?php echo Form::input('username',null,array('id'=>'login-uid','size'=>40,'class'=>'username'));?></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td><b>Password:</b></td></tr>
<tr><td><?php echo Form::password('password',null,array('id'=>'login-pwd','size'=>40,'class'=>'password'));?></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<? if (Kohana::Config('auth.pwreset')) { ?>
<tr><td colspan="2"><?php echo HTML::anchor('login/reset',_('Forgot your password?')); ?></td></tr>
<? } ?>
<tr><td colspan="2" style="text-align: center;"><?php echo Form::submit('submit',_('Authenticate'));?></td></tr>
</table>
<?php echo Form::close(); ?>

View File

@ -1,11 +0,0 @@
##
## Used for storing the next gid and next uid in the the directory
##
objectclass ( 1.3.6.1.4.1.7165.1.2.2.3 NAME 'uidPool' SUP top AUXILIARY
DESC 'Pool for allocating UNIX uids'
MUST ( uidNumber $ cn ) )
objectclass ( 1.3.6.1.4.1.7165.1.2.2.4 NAME 'gidPool' SUP top AUXILIARY
DESC 'Pool for allocating UNIX gids'
MUST ( gidNumber $ cn ) )

1
includes/kohana Submodule

@ -0,0 +1 @@
Subproject commit c8517e61da035c510e9fdbefa4efd2e64dcb0dfe

132
index.php
View File

@ -1,11 +1,131 @@
<?php
// $Header$
/**
* @package phpLDAPadmin
* The directory in which your application specific resources are located.
* The application directory must contain the bootstrap.php file.
*
* @link http://kohanaframework.org/guide/about.install#application
*/
$application = 'application';
/**
* The directory in which your modules are located.
*
* @link http://kohanaframework.org/guide/about.install#modules
*/
$modules = 'modules';
/**
* The directory in which upstream Kohana resources (modules) are located.
*/
$sysmodules = 'includes/kohana/modules';
/**
* The directory in which the Kohana resources are located. The system
* directory must contain the classes/kohana.php file.
*
* @link http://kohanaframework.org/guide/about.install#system
*/
$system = 'includes/kohana/system';
/**
* The default extension of resource files. If you change this, all resources
* must be renamed to use the new extension.
*
* @link http://kohanaframework.org/guide/about.install#ext
*/
define('EXT', '.php');
/**
* Set the PHP error reporting level. If you set this in php.ini, you remove this.
* @link http://www.php.net/manual/errorfunc.configuration#ini.error-reporting
*
* When developing your application, it is highly recommended to enable notices
* and strict warnings. Enable them by using: E_ALL | E_STRICT
*
* In a production environment, it is safe to ignore notices and strict warnings.
* Disable them by using: E_ALL ^ E_NOTICE
*
* When using a legacy application with PHP >= 5.3, it is recommended to disable
* deprecated notices. Disable with: E_ALL & ~E_DEPRECATED
*/
error_reporting(E_ALL | E_STRICT);
/**
* End of standard configuration! Changing any of the code below should only be
* attempted by those with a working knowledge of Kohana internals.
*
* @link http://kohanaframework.org/guide/using.configuration
*/
# You should secure your PLA by making the htdocs/ your docroot.
header('Location: htdocs/index.php');
die();
?>
// Set the full path to the docroot
define('DOCROOT', realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR);
// Make the application relative to the docroot, for symlink'd index.php
if ( ! is_dir($application) AND is_dir(DOCROOT.$application))
$application = DOCROOT.$application;
// Make the modules relative to the docroot, for symlink'd index.php
if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules))
$modules = DOCROOT.$modules;
// Make the system relative to the docroot, for symlink'd index.php
if ( ! is_dir($sysmodules) AND is_dir(DOCROOT.$sysmodules))
$sysmodules = DOCROOT.$sysmodules;
// Make the system relative to the docroot, for symlink'd index.php
if ( ! is_dir($system) AND is_dir(DOCROOT.$system))
$system = DOCROOT.$system;
// Define the absolute paths for configured directories
define('APPPATH', realpath($application).DIRECTORY_SEPARATOR);
define('MODPATH', realpath($modules).DIRECTORY_SEPARATOR);
define('SMDPATH', realpath($sysmodules).DIRECTORY_SEPARATOR);
define('SYSPATH', realpath($system).DIRECTORY_SEPARATOR);
// Clean up the configuration vars
unset($application, $modules, $sysmodules, $system);
if (file_exists('install'.EXT))
{
// Load the installation check
return include 'install'.EXT;
}
/**
* Define the start time of the application, used for profiling.
*/
if ( ! defined('KOHANA_START_TIME'))
{
define('KOHANA_START_TIME', microtime(TRUE));
}
/**
* Define the memory usage at the start of the application, used for profiling.
*/
if ( ! defined('KOHANA_START_MEMORY'))
{
define('KOHANA_START_MEMORY', memory_get_usage());
}
// Bootstrap the application
require APPPATH.'bootstrap'.EXT;
if (PHP_SAPI == 'cli') // Try and load minion
{
class_exists('Minion_Task') OR die('Please enable the Minion module for CLI support.');
set_exception_handler(array('Minion_Exception', 'handler'));
Minion_Task::factory(Minion_CLI::options())->execute();
}
else
{
/**
* Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
* If no source is specified, the URI will be automatically detected.
*/
echo Request::factory(TRUE, array(), FALSE)
->execute()
->send_headers(TRUE)
->body();
}

View File

@ -264,6 +264,9 @@ class TemplateRender extends PageRender {
*
* * arg 8 (for MultiList)
* - size of displayed list (default: 10 lines)
*
* * arg 9
* - if whether to include parent in sub query TRUE|FALSE
*/
case 'MultiList':
case 'PickList':
@ -322,6 +325,9 @@ class TemplateRender extends PageRender {
$vals = array();
foreach ($picklistvalues as $key => $values) {
if (! empty($args[9]) && $container == $key)
continue;
$display = $args[3];
foreach ($matchall[1] as $key => $arg) {

View File

@ -910,7 +910,7 @@ class ldap extends DS {
$dn = $this->getContainer($dn);
if ($dn == $top)
break;
continue;
} elseif($value)
$dn = sprintf('%s,%s',$value,$dn);

1
modules/ldap Submodule

@ -0,0 +1 @@
Subproject commit 867098afdeb20de8d4c91b0ccb2ede09cdb7591b

1
modules/lnapp Submodule

@ -0,0 +1 @@
Subproject commit a889d25eda0d6c1b8766b15f2d71f3dd4f0357d9