diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..1e2e54e --- /dev/null +++ b/.htaccess @@ -0,0 +1,21 @@ +# Turn on URL rewriting +RewriteEngine On + +# Installation directory +RewriteBase /pla + +# Protect hidden files from being viewed + + Order Deny,Allow + Deny From All + + +# 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] diff --git a/application/bootstrap.php b/application/bootstrap.php new file mode 100644 index 0000000..ce10bca --- /dev/null +++ b/application/bootstrap.php @@ -0,0 +1,150 @@ +" + */ +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 + '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(/)', 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', '((/(/)))', 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.'); +} +?> diff --git a/application/classes/Cookie.php b/application/classes/Cookie.php new file mode 100644 index 0000000..ca46255 --- /dev/null +++ b/application/classes/Cookie.php @@ -0,0 +1,16 @@ + diff --git a/application/classes/controller/welcome.php b/application/classes/controller/welcome.php new file mode 100644 index 0000000..3b1c979 --- /dev/null +++ b/application/classes/controller/welcome.php @@ -0,0 +1,8 @@ +response->body('hello, world!'); + } +} // End Welcome diff --git a/doc/exmail.schema b/doc/exmail.schema new file mode 100644 index 0000000..728efa6 --- /dev/null +++ b/doc/exmail.schema @@ -0,0 +1,434 @@ +# +# Author: Stefan Klatt +# Email: stefan.klatt@cac-netzwerk.de +# Datum: 05.03.2007 +# Version: 0.99.4 +# +# OID-Prefix: 1.3.6.1.4.1.25926 +# +# Attribute: 1.3.6.1.4.1.25926.1.1.1 +# +# Objects: 1.3.6.1.4.1.25926.1.1.100 +# +# 0.99.04 +# 05.03.2007 +# - ipprotocolnumber musste in integer umgeaendert werden, da das NIS Schema +# nicht mehr verwendet wird +# +# +# 0.99.05 +# 24.04.2011 +# +# - Userattribut active hinzugefügt + +attributetype ( 1.3.6.1.4.1.25926.1.1.1 + name 'EXLocalEmail' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.2 + name 'EXRemoteEmail' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.3 + name 'EXServer' + Sup name ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.4 + name 'EXUser-ID' + Sup name ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.5 + name 'EXPassword' + Sup name ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.6 + name 'EXActive' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.7 + name 'EXSSL' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.8 + name 'EXEmailonServer' + desc 'Nachrichten auf dem Server lassen' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.9 + name 'EXPort' + EQUALITY IntegerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.10 + name 'EXTimer' + desc 'Zeit zwischen den Abfragen, Zahl sollte ein Teiler von 60 sein' + EQUALITY IntegerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.11 + name 'EXServerTyp' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{10} + ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.12 + name 'EXHTTPS' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.13 + name 'EXTLSReq' + desc 'Require TLS' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.14 + name 'EXAuthTry' + desc 'Try SMTP Auth' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.15 + name 'EXAuthReq' + desc 'Require SMTP Auth' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.16 + name 'EXSMTPPOP' + desc 'SMTP after POP' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.17 + name 'EXFetch' + desc 'Fetchmail-Account Bezeichnung' + EQUALITY caseIgnoreIA5Match + SUBSTR caseIgnoreIA5SubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.18 + name 'EXsmtp' + desc 'SMTP-Account Bezeichnung' + EQUALITY caseIgnoreIA5Match + SUBSTR caseIgnoreIA5SubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.20 + name 'EXwebm' + desc 'WebMail-Account Bezeichnung' + EQUALITY caseIgnoreIA5Match + SUBSTR caseIgnoreIA5SubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.21 + name 'EXDomainIMAP' + EQUALITY caseIgnoreIA5Match + SUBSTR caseIgnoreIA5SubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.22 + name 'EXDomainExt' + EQUALITY caseIgnoreIA5Match + SUBSTR caseIgnoreIA5SubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.23 + name 'EXMaxMsgSize' + desc 'Max Emailsize' + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.24 + name 'EXMaxMsgTxt' + desc 'Text for max Emailsize' + EQUALITY caseIgnoreIA5Match + SUBSTR caseIgnoreIA5SubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.25 + name 'EXAlias' + desc 'Alias to change' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.26 + name 'EXRecipient' + desc 'Recipient for Email' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.27 + name 'EXDefaultTimer' + desc 'Default Zeit zwischen den Abfragen, Zahl sollte ein Teiler von 60 sein' + EQUALITY IntegerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.28 + name 'EXMailDir' + desc 'Directory for Mails' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.29 + name 'EXFilter1' + desc 'Filter Zeile1' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{100} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.30 + name 'EXFilter2' + desc 'Filter Zeile2' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{100} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.31 + name 'EXFilter3' + desc 'Filter Zeile3' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{100} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.32 + name 'EXFilter4' + desc 'Filter Zeile4' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{100} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.33 + name 'EXFilter5' + desc 'Filter Zeile5' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{100} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.34 + name 'EXFilter6' + desc 'Filter Zeile6' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{100} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.35 + name 'EXIMAPDir' + desc 'Filter Zeile6' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{100} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.36 + name 'EXCondition' + desc 'Filter Condition' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{100} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.37 + name 'EXStatus' + desc 'Wurde Filter geändert' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.38 + name 'EXHomeDir' + desc 'Imap User Homedirectory' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{200} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.39 + name 'EXFilterTyp' + desc 'EXFilter Typ - Subject, From, To, FromTo, Subject, Msgbody' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{200} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.40 + name 'EXUserinfos' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{200} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.41 + name 'EXFilter' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{200} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.42 + name 'EXFilterGen' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{200} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.43 + name 'EXSpam' + desc 'Spam im Spam-Verzeichnis des Users einsortieren' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.44 + name 'EXEmailCopy' + desc 'Eine Kopie der gesendeten Email durch den Userfilter schicken um diese im selben Verzeichnis abzulegen' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.45 + name 'EXDomain-Infos' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{200} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.46 + name 'EXSharedFolder' + desc 'Ablage der Emails unter shared ' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.47 + name 'EXFilterOut' + desc 'EXFilter direction Out' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.48 + name 'EXVacation' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.49 + name 'EXVacationSubject' + desc 'Vacation Subject' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1000} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.50 + name 'EXVacationMsg' + desc 'Vacation Message' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1000} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.51 + name 'EXFilterIn' + desc 'EXFilter direction In' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.52 + name 'EXUserSpamDir' + desc 'Maildir for Spams identify by User ' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1000} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.53 + name 'EXUserHamDir' + desc 'Maildir for false recognized Spams identify by User ' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1000} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.54 + name 'EXNotPersonal' + desc 'Test if Email is not from a person' + EQUALITY BooleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) + +attributetype ( 1.3.6.1.4.1.25926.1.1.55 + name 'EXGlobalPublicDir' + desc 'Imap global public directory' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{200} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.56 + name 'EXAddr2' + desc 'Filter Email-Adresse' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{100} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.57 + name 'EXAddr2Direction' + desc 'EXFilter Typ - Subject, From, To, FromTo, Subject, Msgbody' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{200} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.58 + name 'EXDomainRelay' + desc 'Host - Domain Relays' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{200} ) + +attributetype ( 1.3.6.1.4.1.25926.1.1.60 + name 'EXVacationDays' + desc 'Vacation days' + EQUALITY IntegerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE) + + +objectClass ( 1.3.6.1.4.1.25926.1.1.100 + name 'EXSMTP-Account' + STRUCTURAL + must ( EXsmtp $ EXRemoteEmail $ EXServer $ EXUser-ID $ + EXPassword $ EXActive + ) + may ( EXPort $ EXAuthTry $ EXAuthReq $ EXTLSReq $ EXSMTPPOP $ EXTimer + ) + ) + +objectClass ( 1.3.6.1.4.1.25926.1.1.101 + name 'EXFetchmail-Account' + STRUCTURAL + must ( EXFetch $ EXRemoteEmail $ EXServer $ EXServerTyp $ + EXUser-ID $ EXPassword $ EXActive $ EXTimer + ) + may ( EXSSL $ EXEmailonServer $ EXPort $ EXTLSReq + ) + ) + + +objectClass ( 1.3.6.1.4.1.25926.1.1.103 + name 'EXWebMail-Account' + STRUCTURAL + must ( EXwebm $ EXRemoteEmail $ EXServer $ EXUser-ID $ + EXPassword $ EXServertyp $ EXActive + ) + may ( EXEmailonServer $ EXPort $ EXTimer $ EXHTTPS + ) + ) + +objectClass ( 1.3.6.1.4.1.25926.1.1.104 + name 'EXDomain-Infos' + STRUCTURAL + must ( EXDomain-Infos $ EXDomainIMAP $ EXDomainExt $ EXGlobalPublicDir $ + EXDefaultTimer $ EXMailDir $ EXUserSpamDir $ EXUserHamDir + ) + may ( EXMaxMsgSize $ EXMaxMsgTxt $ EXDomainRelay + ) + ) + +objectClass ( 1.3.6.1.4.1.25926.1.1.105 + name 'EXAlias' + STRUCTURAL + must ( EXAlias $ EXRecipient + ) + ) + + +objectClass ( 1.3.6.1.4.1.25926.1.1.106 + name 'EXUserinfos' + STRUCTURAL + must ( EXUserinfos $ EXHomeDir $ EXSpam $ EXEmailCopy $ + EXSharedFolder $ EXStatus $ + EXVacation $ EXVacationSubject $ EXVacationMsg $ EXVacationDays + ) + ) + +objectClass ( 1.3.6.1.4.1.25926.1.1.107 + name 'EXFilterGen' + STRUCTURAL + must ( EXFilterGen $ EXFilter1 $ EXStatus $ EXFilterOut $ EXFilterIn + ) + may ( EXFilter2 $ EXFilter3 $ EXFilter4 $ EXFilter5 $ EXFilter6 + ) + ) + +objectClass ( 1.3.6.1.4.1.25926.1.1.108 + name 'EXFilter' + STRUCTURAL + must ( EXFilter $ EXCondition $ EXIMAPDir $ EXStatus $ + EXFilterTyp $ EXFilterOut $ EXFilterIn + ) + may ( EXNotPersonal $ EXAddr2 $ EXAddr2Direction + ) + ) diff --git a/doc/ldif-example.com b/doc/ldif-example.com index 8c6cdfb..2a9c173 100644 --- a/doc/ldif-example.com +++ b/doc/ldif-example.com @@ -27,21 +27,21 @@ objectclass: organizationalUnit ou: Bad DNs # Entry 4: c=double plus \2B\2B,ou=Bad DNs,dc=example.com -dn: c=double plus \2B\2B,ou=Bad DNs,dc=example.com -c: double plus ++ -objectclass: country +#dn: c=double plus \2B\2B,ou=Bad DNs,dc=example.com +#c: double plus \2B\2B +#objectclass: country # Entry 5: c=end dollar$,ou=Bad DNs,dc=example.com -dn: c=end dollar$,ou=Bad DNs,dc=example.com -c: end dollar$ -objectclass: country +#dn: c=end dollar$,ou=Bad DNs,dc=example.com +#c: end dollar$ +#objectclass: country # Entry 6: sn=sign@at+uid=multi-mixed,ou=Bad DNs,dc=example.com -dn: sn=sign@at+uid=multi-mixed,ou=Bad DNs,dc=example.com -cn: Test -objectclass: inetOrgPerson -sn: sign@at -uid: multi-mixed +#dn: sn=sign@at+uid=multi-mixed,ou=Bad DNs,dc=example.com +#cn: Test +#objectclass: inetOrgPerson +#sn: sign@at +#uid: multi-mixed # Entry 7: uid=angle\3Cleft,ou=Bad DNs,dc=example.com dn: uid=angle\3Cleft,ou=Bad DNs,dc=example.com @@ -86,20 +86,20 @@ sn: Test uid: colon;semi # Entry 13: uid=multi+uid=sign@at,ou=Bad DNs,dc=example.com -dn: uid=multi+uid=sign@at,ou=Bad DNs,dc=example.com -cn: Test -objectclass: inetOrgPerson -sn: Test -uid: multi -uid: sign@at +#dn: uid=multi+uid=sign@at,ou=Bad DNs,dc=example.com +#cn: Test +#objectclass: inetOrgPerson +#sn: Test +#uid: multi +#uid: sign@at # Entry 14: uid=multi+uid=value,ou=Bad DNs,dc=example.com -dn: uid=multi+uid=value,ou=Bad DNs,dc=example.com -cn: Test -objectclass: inetOrgPerson -sn: Test -uid: multi -uid: value +#dn: uid=multi+uid=value,ou=Bad DNs,dc=example.com +#cn: Test +#objectclass: inetOrgPerson +#sn: Test +#uid: multi +#uid: value # Entry 15: uid=quote\22double,ou=Bad DNs,dc=example.com dn: uid=quote\22double,ou=Bad DNs,dc=example.com diff --git a/doc/mozillaOrgPerson.schema b/doc/mozillaOrgPerson.schema new file mode 100644 index 0000000..aeace49 --- /dev/null +++ b/doc/mozillaOrgPerson.schema @@ -0,0 +1,177 @@ +# +# mozillaOrgPerson schema v. 0.6.3 +# + +# req. core +# req. cosine +# req. inetorgperson + +# attribute defs + +attributetype ( 1.3.6.1.4.1.13769.2.1.1 + NAME ( 'mozillaNickname' ) + SUP name ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.2 + NAME ( 'mozillaUseHtmlMail' ) + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 + SINGLE-VALUE ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.3 + NAME 'mozillaSecondEmail' + EQUALITY caseIgnoreIA5Match + SUBSTR caseIgnoreIA5SubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.4 + NAME 'mozillaHomeLocalityName' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.5 + NAME 'mozillaPostalAddress2' + EQUALITY caseIgnoreListMatch + SUBSTR caseIgnoreListSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.6 + NAME 'mozillaHomePostalAddress2' + EQUALITY caseIgnoreListMatch + SUBSTR caseIgnoreListSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.7 + NAME ( 'mozillaHomeState' ) SUP name ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.8 + NAME 'mozillaHomePostalCode' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.9 + NAME ( 'mozillaHomeCountryName' ) + SUP name SINGLE-VALUE ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.10 + NAME ( 'mozillaHomeFriendlyCountryName' ) + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.11 + NAME ( 'mozillaHomeUrl' ) + EQUALITY caseIgnoreIA5Match + SUBSTR caseIgnoreIA5SubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.12 + NAME ( 'mozillaWorkUrl' ) + EQUALITY caseIgnoreIA5Match + SUBSTR caseIgnoreIA5SubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} ) + +# un-comment for all LDAP server NOT supporting SYNTAX 2.16.840.1.113730.3.7.1 +attributetype ( 1.3.6.1.4.1.13769.2.1.13 + NAME ( 'nsAIMid' ) + DESC 'AOL Instant Messenger (AIM) Identity' + EQUALITY telephoneNumberMatch + SUBSTR telephoneNumberSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.14 NAME ( 'mozillaHomeStreet' ) + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} ) + +# un-comment for Netscape 6.x and all other LDAP server supporting SYNTAX 2.16.840.1.113730.3.7.1 +# attributeTypes ( 2.16.840.1.113730.3.1.2013 +# NAME ( 'nsAIMid' ) +# DESC 'AOL Instant Messenger (AIM) Identity' +# SYNTAX 2.16.840.1.113730.3.7.1 ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.96 + NAME ( 'mozillaCustom1' ) + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + SINGLE-VALUE ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.97 + NAME ( 'mozillaCustom2' ) + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + SINGLE-VALUE ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.98 + NAME ( 'mozillaCustom3' ) + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + SINGLE-VALUE ) + +attributetype ( 1.3.6.1.4.1.13769.2.1.99 + NAME ( 'mozillaCustom4' ) + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + SINGLE-VALUE ) + +# defined in "A Summary of the X.500(96) User Schema for use with LDAPv3" - RFC 2256 +# +# attributetype ( 2.5.4.6 NAME ( 'c' 'countryName' ) +# DESC 'RFC2256: ISO-3166 country 2-letter code' +# SUP name SINGLE-VALUE ) + +# defined in "The COSINE and Internet X.500 Schema" - RFC 1274 +# +# attributetype ( 0.9.2342.19200300.100.1.43 +# NAME ( 'co' 'friendlyCountryName' ) +# DESC 'RFC1274: friendly country name' +# EQUALITY caseIgnoreMatch +# SUBSTR caseIgnoreSubstringsMatch +# SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) + + +# objectClass defs + +objectclass ( 1.3.6.1.4.1.13769.2.2.1 + NAME 'mozillaOrgPerson' + SUP top + AUXILIARY + MAY ( + sn $ + givenName $ + cn $ + displayName $ + mozillaNickname $ + title $ + telephoneNumber $ + facsimileTelephoneNumber $ + mobile $ + pager $ + homePhone $ + street $ + postalCode $ + mozillaPostalAddress2 $ + mozillaHomeStreet $ + mozillaHomePostalAddress2 $ + l $ + mozillaHomeLocalityName $ + st $ + mozillaHomeState $ + mozillaHomePostalCode $ + c $ + mozillaHomeCountryName $ + co $ + mozillaHomeFriendlyCountryName $ + ou $ + o $ + mail $ + mozillaSecondEmail $ + mozillaUseHtmlMail $ + nsAIMid $ + mozillaHomeUrl $ + mozillaWorkUrl $ + description $ + mozillaCustom1 $ + mozillaCustom2 $ + mozillaCustom3 $ + mozillaCustom4 ) ) + +# not part of the official Mozilla schema but read by Mozilla: 'departmentNumber' and 'postOfficeBox' +# diff --git a/doc/phpldapadmin-demo.conf b/doc/phpldapadmin-demo.conf index 3ed4063..a29b837 100644 --- a/doc/phpldapadmin-demo.conf +++ b/doc/phpldapadmin-demo.conf @@ -1,6 +1,6 @@ include /etc/openldap/schema/uidpool.schema include /etc/openldap/schema/sudo.schema -include /etc/openldap/schema/autofs.schema +include /etc/openldap/schema/exmail.schema TLSCACertificateFile /etc/openldap/pla/ca-bundle.crt TLSCertificateFile /etc/openldap/pla/slapd.crt @@ -35,7 +35,7 @@ access to * authz-policy any -database ldbm +database bdb suffix "dc=example.com" rootdn "cn=Manager,dc=example.com" rootpw NotAllowed @@ -50,7 +50,7 @@ index uidNumber,gidNumber,loginShell eq,pres index uid,memberUid eq,pres,sub index nisMapName,nisMapEntry eq,pres,sub -database ldbm +database bdb suffix "dc=example,dc=com" rootdn "cn=Manager,dc=example,dc=com" rootpw NotAllowed @@ -65,7 +65,7 @@ index uidNumber,gidNumber,loginShell eq,pres index uid,memberUid eq,pres,sub index nisMapName,nisMapEntry eq,pres,sub -database ldbm +database bdb suffix "o=Simpsons" rootdn "cn=Manager,o=Simpsons" rootpw NotAllowed diff --git a/doc/sudo.schema b/doc/sudo.schema new file mode 100644 index 0000000..802405a --- /dev/null +++ b/doc/sudo.schema @@ -0,0 +1,37 @@ +attributetype ( 1.3.6.1.4.1.15953.9.1.1 + NAME 'sudoUser' + DESC 'User(s) who may run sudo' + EQUALITY caseExactIA5Match + SUBSTR caseExactIA5SubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.15953.9.1.2 + NAME 'sudoHost' + DESC 'Host(s) who may run sudo' + EQUALITY caseExactIA5Match + SUBSTR caseExactIA5SubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.15953.9.1.3 + NAME 'sudoCommand' + DESC 'Command(s) to be executed by sudo' + EQUALITY caseExactIA5Match + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.15953.9.1.4 + NAME 'sudoRunAs' + DESC 'User(s) impersonated by sudo' + EQUALITY caseExactIA5Match + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +attributetype ( 1.3.6.1.4.1.15953.9.1.5 + NAME 'sudoOption' + DESC 'Options(s) followed by sudo' + EQUALITY caseExactIA5Match + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) + +objectclass ( 1.3.6.1.4.1.15953.9.2.1 NAME 'sudoRole' SUP top STRUCTURAL + DESC 'Sudoer Entries' + MUST ( cn ) + MAY ( sudoUser $ sudoHost $ sudoCommand $ sudoRunAs $ sudoOption + $description ) ) diff --git a/includes/kohana/modules/minion/classes/Kohana/Minion/CLI.php b/includes/kohana/modules/minion/classes/Kohana/Minion/CLI.php index 13c1de6..4a1196b 100644 --- a/includes/kohana/modules/minion/classes/Kohana/Minion/CLI.php +++ b/includes/kohana/modules/minion/classes/Kohana/Minion/CLI.php @@ -92,7 +92,7 @@ class Kohana_Minion_CLI { { foreach ($values as $opt => $value) { - if ( ! in_array($opt, $options)) + if ( ! in_array($opt, $options, TRUE)) { // Set the given value unset($values[$opt]); diff --git a/includes/kohana/modules/unittest/bootstrap.php b/includes/kohana/modules/unittest/bootstrap.php index 177dae1..2abe238 100644 --- a/includes/kohana/modules/unittest/bootstrap.php +++ b/includes/kohana/modules/unittest/bootstrap.php @@ -15,13 +15,15 @@ $application = 'application'; */ $modules = 'modules'; +$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 = 'system'; +$system = 'includes/kohana/system'; /** * The default extension of resource files. If you change this, all resources @@ -74,6 +76,12 @@ 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 if ( ! is_dir($system) AND is_dir(DOCROOT.$system)) { @@ -83,10 +91,11 @@ if ( ! is_dir($system) AND is_dir(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, $system); +unset($application, $modules, $sysmodules, $system); /** * Define the start time of the application, used for profiling. @@ -104,6 +113,8 @@ if ( ! defined('KOHANA_START_MEMORY')) define('KOHANA_START_MEMORY', memory_get_usage()); } +define('PHPUNITTEST','192.168.242.3'); + // Bootstrap the application require APPPATH.'bootstrap'.EXT; @@ -122,4 +133,4 @@ if (($ob_len = ob_get_length()) !== FALSE) } // Enable the unittest module -Kohana::modules(Kohana::modules() + array('unittest' => MODPATH.'unittest')); \ No newline at end of file +Kohana::modules(Kohana::modules() + array('unittest' => SMDPATH.'unittest')); diff --git a/includes/kohana/system/classes/Kohana/Debug.php b/includes/kohana/system/classes/Kohana/Debug.php index 9d1efdf..ccc141d 100644 --- a/includes/kohana/system/classes/Kohana/Debug.php +++ b/includes/kohana/system/classes/Kohana/Debug.php @@ -252,13 +252,17 @@ class Kohana_Debug { { $file = 'APPPATH'.DIRECTORY_SEPARATOR.substr($file, strlen(APPPATH)); } + elseif (strpos($file, MODPATH) === 0) + { + $file = 'MODPATH'.DIRECTORY_SEPARATOR.substr($file, strlen(MODPATH)); + } elseif (strpos($file, SYSPATH) === 0) { $file = 'SYSPATH'.DIRECTORY_SEPARATOR.substr($file, strlen(SYSPATH)); } - elseif (strpos($file, MODPATH) === 0) + elseif (strpos($file, SMDPATH) === 0) { - $file = 'MODPATH'.DIRECTORY_SEPARATOR.substr($file, strlen(MODPATH)); + $file = 'SMDPATH'.DIRECTORY_SEPARATOR.substr($file, strlen(SMDPATH)); } elseif (strpos($file, DOCROOT) === 0) { diff --git a/includes/kohana/system/tests/kohana/CoreTest.php b/includes/kohana/system/tests/kohana/CoreTest.php index beb508b..17d6a7a 100644 --- a/includes/kohana/system/tests/kohana/CoreTest.php +++ b/includes/kohana/system/tests/kohana/CoreTest.php @@ -250,7 +250,7 @@ class Kohana_CoreTest extends Unittest_TestCase { return array( array(array('unittest' => MODPATH.'fo0bar')), - array(array('unittest' => MODPATH.'unittest', 'fo0bar' => MODPATH.'fo0bar')), + array(array('unittest' => SMDPATH.'unittest', 'fo0bar' => MODPATH.'fo0bar')), ); } @@ -292,7 +292,7 @@ class Kohana_CoreTest extends Unittest_TestCase { return array( array(array(), array()), - array(array('unittest' => MODPATH.'unittest'), array('unittest' => $this->dirSeparator(MODPATH.'unittest/'))), + array(array('unittest' => SMDPATH.'unittest'), array('unittest' => $this->dirSeparator(SMDPATH.'unittest/'))), ); } diff --git a/includes/kohana/system/tests/kohana/DebugTest.php b/includes/kohana/system/tests/kohana/DebugTest.php index 39176ec..5bc7149 100644 --- a/includes/kohana/system/tests/kohana/DebugTest.php +++ b/includes/kohana/system/tests/kohana/DebugTest.php @@ -59,8 +59,8 @@ class Kohana_DebugTest extends Unittest_TestCase 'SYSPATH'.DIRECTORY_SEPARATOR.'classes'.DIRECTORY_SEPARATOR.'kohana.php' ), array( - MODPATH.$this->dirSeparator('unittest/classes/kohana/unittest/runner').EXT, - $this->dirSeparator('MODPATH/unittest/classes/kohana/unittest/runner').EXT + SMDPATH.$this->dirSeparator('unittest/classes/kohana/unittest/runner').EXT, + $this->dirSeparator('SMDPATH/unittest/classes/kohana/unittest/runner').EXT ), ); } diff --git a/index.php b/index.php index 716e607..c7bb26f 100644 --- a/index.php +++ b/index.php @@ -1,11 +1,131 @@ = 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(); +} diff --git a/modules/lnApp/classes/Block.php b/modules/lnApp/classes/Block.php new file mode 100644 index 0000000..0b6b536 --- /dev/null +++ b/modules/lnApp/classes/Block.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/Block/Sub.php b/modules/lnApp/classes/Block/Sub.php new file mode 100644 index 0000000..2304a53 --- /dev/null +++ b/modules/lnApp/classes/Block/Sub.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/BreadCrumb.php b/modules/lnApp/classes/BreadCrumb.php new file mode 100644 index 0000000..2b44bf8 --- /dev/null +++ b/modules/lnApp/classes/BreadCrumb.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/Controller/Default.php b/modules/lnApp/classes/Controller/Default.php new file mode 100644 index 0000000..e59300d --- /dev/null +++ b/modules/lnApp/classes/Controller/Default.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/Controller/Login.php b/modules/lnApp/classes/Controller/Login.php new file mode 100644 index 0000000..74a1883 --- /dev/null +++ b/modules/lnApp/classes/Controller/Login.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/Controller/Logout.php b/modules/lnApp/classes/Controller/Logout.php new file mode 100644 index 0000000..090c4a9 --- /dev/null +++ b/modules/lnApp/classes/Controller/Logout.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/Controller/Media.php b/modules/lnApp/classes/Controller/Media.php new file mode 100644 index 0000000..b478c75 --- /dev/null +++ b/modules/lnApp/classes/Controller/Media.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/Controller/Task.php b/modules/lnApp/classes/Controller/Task.php new file mode 100644 index 0000000..35383c9 --- /dev/null +++ b/modules/lnApp/classes/Controller/Task.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/HTML.php b/modules/lnApp/classes/HTML.php new file mode 100644 index 0000000..8cad46f --- /dev/null +++ b/modules/lnApp/classes/HTML.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/HTMLRender.php b/modules/lnApp/classes/HTMLRender.php new file mode 100644 index 0000000..e887d1b --- /dev/null +++ b/modules/lnApp/classes/HTMLRender.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/HeadImages.php b/modules/lnApp/classes/HeadImages.php new file mode 100644 index 0000000..74d735e --- /dev/null +++ b/modules/lnApp/classes/HeadImages.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/Meta.php b/modules/lnApp/classes/Meta.php new file mode 100644 index 0000000..006de23 --- /dev/null +++ b/modules/lnApp/classes/Meta.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/PWGen.php b/modules/lnApp/classes/PWGen.php new file mode 100644 index 0000000..025ab76 --- /dev/null +++ b/modules/lnApp/classes/PWGen.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/Random.php b/modules/lnApp/classes/Random.php new file mode 100644 index 0000000..f4591d2 --- /dev/null +++ b/modules/lnApp/classes/Random.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/Script.php b/modules/lnApp/classes/Script.php new file mode 100644 index 0000000..1e03000 --- /dev/null +++ b/modules/lnApp/classes/Script.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/Sort.php b/modules/lnApp/classes/Sort.php new file mode 100644 index 0000000..d444567 --- /dev/null +++ b/modules/lnApp/classes/Sort.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/Style.php b/modules/lnApp/classes/Style.php new file mode 100644 index 0000000..18e54da --- /dev/null +++ b/modules/lnApp/classes/Style.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/SystemMessage.php b/modules/lnApp/classes/SystemMessage.php new file mode 100644 index 0000000..6753b7c --- /dev/null +++ b/modules/lnApp/classes/SystemMessage.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/Table.php b/modules/lnApp/classes/Table.php new file mode 100644 index 0000000..8c98abd --- /dev/null +++ b/modules/lnApp/classes/Table.php @@ -0,0 +1,4 @@ + diff --git a/modules/lnApp/classes/lnApp/Block.php b/modules/lnApp/classes/lnApp/Block.php new file mode 100644 index 0000000..5569796 --- /dev/null +++ b/modules/lnApp/classes/lnApp/Block.php @@ -0,0 +1,84 @@ + '; + protected static $_required_keys = array('body'); + + /** + * Add a block to be rendered + * + * @param array Block attributes + */ + public static function add($block,$prepend=FALSE) { + // Any body objects should be converted to a string, so that any calls to Style/Script are processed + if (isset($block['body'])) + $block['body'] = (string)$block['body']; + + parent::add($block); + + // Detect any style sheets. + if (! empty($block['style']) && is_array($block['style'])) + foreach ($block['style'] as $data=>$media) + Style::add(array( + 'type'=>'file', + 'data'=>$data, + 'media'=>$media, + )); + } + + /** + * Return an instance of this class + * + * @return Block + */ + public static function factory() { + return new Block; + } + + /** + * Render this block + * + * @see HTMLRender::render() + */ + protected function render() { + $output = ''; + $styles = array(); + + $i = 0; + foreach (static::$_data as $value) { + if ($i++) + $output .= static::$_spacer; + + $output .= ''; + + if (! empty($value['title'])) + $output .= sprintf('',$value['title']); + + if (! empty($value['subtitle'])) + $output .= sprintf('',$value['subtitle']); + + $output .= sprintf('',$value['body']); + + if (! empty($value['footer'])) + $output .= sprintf('',$value['footer']); + + $output .= '
%s
%s
%s
'; + } + + return $output; + } +} +?> diff --git a/modules/lnApp/classes/lnApp/Block/Sub.php b/modules/lnApp/classes/lnApp/Block/Sub.php new file mode 100644 index 0000000..bb03868 --- /dev/null +++ b/modules/lnApp/classes/lnApp/Block/Sub.php @@ -0,0 +1,94 @@ + '; + protected static $_required_keys = array('body','position'); + + /** + * Add a block to be rendered + * + * @param array Block attributes + */ + public static function add($block,$prepend=FALSE) { + parent::add($block); + + // Detect any style sheets. + if (! empty($block['style']) && is_array($block['style'])) + foreach ($block['style'] as $data=>$media) + Style::add(array( + 'type'=>'file', + 'data'=>$data, + 'media'=>$media, + )); + } + + /** + * Return an instance of this class + * + * @return Block + */ + public static function factory() { + return new Block_Sub; + } + + /** + * Render this block + * + * @see HTMLRender::render() + */ + protected function render() { + $output = ''; + $o = array(); + + $i = 0; + $x = $y = 0; + Sort::MAsort(static::$_data,'order,position,title,subtitle'); + foreach (static::$_data as $value) { + $i = (! isset($value['order'])) ? $i+1 : $value['order']; + + // Work out our dimentions + if ($value['position'] > $y) + $y = $value['position']; + if ($i > $x) + $x = $i; + + // @todo Alert if a sub block has already been defined. + $o[$i][$value['position']] = ''; + + if (! empty($value['title'])) + $o[$i][$value['position']] .= sprintf('',$value['title']); + + if (! empty($value['subtitle'])) + $o[$i][$value['position']] .= sprintf('',$value['subtitle']); + + $o[$i][$value['position']] .= sprintf('',$value['body']); + + if (! empty($value['footer'])) + $o[$i][$value['position']] .= sprintf('',$value['footer']); + + $o[$i][$value['position']] .= '
%s
%s
%s
'; + } + + // Render our output. + $output .= ''; + foreach ($o as $k => $v) + $output .= sprintf('',$x=round(100/$y,0),implode(sprintf('
%s
',$x),$v)); + $output .= '
'; + + return $output; + } +} +?> diff --git a/modules/lnApp/classes/lnApp/BreadCrumb.php b/modules/lnApp/classes/lnApp/BreadCrumb.php new file mode 100644 index 0000000..d6ed3de --- /dev/null +++ b/modules/lnApp/classes/lnApp/BreadCrumb.php @@ -0,0 +1,92 @@ +'; + $output .= '
  • '.HTML::anchor('/',_('Home')).'
  • '; + + $data = empty(static::$_data['path']) ? explode('/',preg_replace('/^\//','',Request::detect_uri())) : static::$_data['path']; + + $c = count($data); + $i=0; + foreach ($data as $k => $v) { + $i++; + + $p = join('/',array_slice($data,0,$k+1)); + $output .= $i==$c ? '
  • ' : '
  • '; + $output .= HTML::anchor( + (empty(static::$_data['url'][$p]) ? $p : static::$_data['url'][$p]), + (empty(static::$_data['name'][$p]) ? ucfirst($v) : static::$_data['name'][$p]) + ); + $output .= '
  • '; + } + + $output .= ''; + return $output; + } +} +?> diff --git a/modules/lnApp/classes/lnApp/Controller/Default.php b/modules/lnApp/classes/lnApp/Controller/Default.php new file mode 100644 index 0000000..d988e65 --- /dev/null +++ b/modules/lnApp/classes/lnApp/Controller/Default.php @@ -0,0 +1,89 @@ + 'admin' will only allow users with the role admin to access action_adminpanel + * 'moderatorpanel' => array('login', 'moderator') will only allow users with the roles login and moderator to access action_moderatorpanel + * + * @var array actions that require a valid user + */ + protected $secure_actions = array(); + + /** + * Check and see if this controller needs authentication + * + * if $this->auth_required is TRUE, then the user must be logged in only. + * if $this->auth_required is FALSE, AND $this->secure_actions has an array of + * methods set to TRUE, then the user must be logged in AND a member of the + * role. + * + * @return boolean + */ + protected function _auth_required() { + // If our global configurable is disabled, then continue + if (! Kohana::$config->load('config')->method_security) + return FALSE; + + return (($this->auth_required !== FALSE && Auth::instance()->logged_in() === FALSE) || + (is_array($this->secure_actions) && array_key_exists($this->request->action(),$this->secure_actions) && + Auth::instance()->logged_in($this->secure_actions[$this->request->action()]) === FALSE)); + } + + public function before() { + parent::before(); + + // Check user auth and role + if ($this->_auth_required()) { + // For AJAX/JSON requests, authorisation is controlled in the method. + if (Request::current()->is_ajax() && $this->request->action() === 'json') { + // Nothing required. + + // For no AJAX/JSON requests, display an access page + } elseif (Auth::instance()->logged_in(NULL,get_class($this).'|'.__METHOD__)) { + HTTP::redirect('login/noaccess'); + + } else { + Session::instance()->set('afterlogin',Request::detect_uri()); + HTTP::redirect($this->noauth_redirect); + } + } + } + + public function after() { + parent::after(); + + // Generate and check the ETag for this file + $this->check_cache(sha1($this->response->body())); + } +} +?> diff --git a/modules/lnApp/classes/lnApp/Controller/Login.php b/modules/lnApp/classes/lnApp/Controller/Login.php new file mode 100644 index 0000000..eacb2a5 --- /dev/null +++ b/modules/lnApp/classes/lnApp/Controller/Login.php @@ -0,0 +1,73 @@ +logged_in()!= 0) { + // Redirect to the user account + HTTP::redirect(URL::link('user','welcome/index')); + } + + // If there is a post and $_POST is not empty + if ($_POST) { + // Store our details in a session key + Session::instance()->set(Kohana::$config->load('auth')->session_key,$_POST['username']); + Session::instance()->set('password',$_POST['password']); + + // If the post data validates using the rules setup in the user model + if (Auth::instance()->login($_POST['username'],$_POST['password'])) { + // Redirect to the user account + if ($redir = Session::instance()->get('afterlogin')) { + Session::instance()->delete('afterlogin'); + HTTP::redirect($redir); + + } else + HTTP::redirect(URL::link('user','welcome/index')); + + } else { + // We are not successful logging in, so delete our session data + Session::instance()->delete(Kohana::$config->load('auth')->session_key); + Session::instance()->delete('password'); + + SystemMessage::add(array( + 'title'=>_('Invalid username or password'), + 'type'=>'error', + 'body'=>_('The username or password was invalid.') + )); + } + } + + Block::add(array( + 'title'=>_('Login to server'), + 'body'=>View::factory('login'), + 'style'=>array('css/login.css'=>'screen'), + )); + + Script::add(array('type'=>'stdin','data'=>' + $(document).ready(function() { + $("#ajxbody").click(function() {$("#ajBODY").load("'.$this->request->uri().'/"); return false;}); + });' + )); + } + + public function action_noaccess() { + SystemMessage::add(array( + 'title'=>_('No access to requested resource'), + 'type'=>'error', + 'body'=>_('You do not have access to the requested resource, please contact your administrator.') + )); + } +} +?> diff --git a/modules/lnApp/classes/lnApp/Controller/Logout.php b/modules/lnApp/classes/lnApp/Controller/Logout.php new file mode 100644 index 0000000..f9b094e --- /dev/null +++ b/modules/lnApp/classes/lnApp/Controller/Logout.php @@ -0,0 +1,27 @@ +logged_in()!= 0) { + $ao = Auth::instance()->get_user(); + Auth::instance()->logout(); + $ao->log('Logged Out'); + + HTTP::redirect('login'); + } + + HTTP::redirect('welcome/index'); + } +} +?> diff --git a/modules/lnApp/classes/lnApp/Controller/Media.php b/modules/lnApp/classes/lnApp/Controller/Media.php new file mode 100644 index 0000000..f9ecda8 --- /dev/null +++ b/modules/lnApp/classes/lnApp/Controller/Media.php @@ -0,0 +1,63 @@ +request->param('file'); + + // Find the file extension + $ext = pathinfo($file,PATHINFO_EXTENSION); + + // Remove the extension from the filename + $file = substr($file,0,-(strlen($ext)+1)); + $f = ''; + + // If our file is pathed with session, our file is in our session. + if ($fd = Session::instance()->get_once($this->request->param('file'))) { + $this->response->body($fd); + + // First try and find media files for the theme-site_id + } elseif ($f = Kohana::find_file($x=sprintf('media/site/%s/theme/%s',Config::siteid(),Config::theme()),$file,$ext)) { + // Send the file content as the response + $this->response->body(file_get_contents($f)); + + // Try and find media files for the site_id + } elseif ($f = Kohana::find_file(sprintf('media/site/%s',Config::siteid()),$file,$ext)) { + // Send the file content as the response + $this->response->body(file_get_contents($f)); + + // If not found try a default media file + } elseif ($f = Kohana::find_file('media',$file,$ext)) { + // Send the file content as the response + $this->response->body(file_get_contents($f)); + + } else { + // Return a 404 status + $this->response->status(404); + } + + // Generate and check the ETag for this file + if (Kohana::$environment === Kohana::PRODUCTION OR Kohana::$config->load('debug')->etag) + $this->check_cache(sha1($this->response->body())); + + // Set the proper headers to allow caching + $this->response->headers('Content-Type',File::mime_by_ext($ext)); + $this->response->headers('Content-Length',(string)$this->response->content_length()); + $this->response->headers('Last-Modified',date('r',$f ? filemtime($f) : time())); + } +} +?> diff --git a/modules/lnApp/classes/lnApp/Controller/Task.php b/modules/lnApp/classes/lnApp/Controller/Task.php new file mode 100644 index 0000000..825af8d --- /dev/null +++ b/modules/lnApp/classes/lnApp/Controller/Task.php @@ -0,0 +1,20 @@ +$this->request->action())); + + parent::before(); + } +} +?> diff --git a/modules/lnApp/classes/lnApp/Controller/TemplateDefault.php b/modules/lnApp/classes/lnApp/Controller/TemplateDefault.php new file mode 100644 index 0000000..2c1c540 --- /dev/null +++ b/modules/lnApp/classes/lnApp/Controller/TemplateDefault.php @@ -0,0 +1,273 @@ + 'admin' will only allow users with the role admin to access action_adminpanel + * 'moderatorpanel' => array('login', 'moderator') will only allow users with the roles login and moderator to access action_moderatorpanel + * + * @var array actions that require a valid user + */ + protected $secure_actions = array( + ); + + public function __construct(Request $request,Response $response) { + // Our Menu's can run without method authentication by default. + if (! isset($this->secure_actions['menu'])) + $this->secure_actions['menu'] = FALSE; + + return parent::__construct($request,$response); + } + + /** + * Check and see if this controller needs authentication + * + * if $this->auth_required is TRUE, then the user must be logged in only. + * if $this->auth_required is FALSE, AND $this->secure_actions has an array of + * methods set to TRUE, then the user must be logged in AND a member of the + * role. + * + * @return boolean + */ + protected function _auth_required() { + // If our global configurable is disabled, then continue + if (! Kohana::$config->load('config')->method_security) + return FALSE; + + return (($this->auth_required !== FALSE && Auth::instance()->logged_in(NULL,get_class($this).'|'.__METHOD__) === FALSE) || + (is_array($this->secure_actions) && array_key_exists($this->request->action(),$this->secure_actions) && + Auth::instance()->logged_in($this->secure_actions[$this->request->action()],get_class($this).'|'.__METHOD__) === FALSE)); + } + + /** + * Loads the template [View] object. + * + * Page information is provided by [meta]. + * @uses meta + */ + public function before() { + // Do not template media files + if ($this->request->action() === 'media') { + $this->auto_render = FALSE; + return; + } + + // Actions that start with ajax, should only be ajax + if (! Kohana::$config->load('debug')->ajax AND preg_match('/^ajax/',Request::current()->action()) AND ! Request::current()->is_ajax()) + die(); + + parent::before(); + + // Check user auth and role + if ($this->_auth_required()) { + if (Kohana::$is_cli) + throw new Kohana_Exception('Cant run :method, authentication not possible',array(':method'=>$this->request->action())); + + // If auth is required and the user is logged in, then they dont have access. + // (We have already checked authorisation.) + if (Auth::instance()->logged_in(NULL,get_class($this).'|'.__METHOD__)) { + if (Config::sitemode() == Kohana::DEVELOPMENT) + SystemMessage::add(array( + 'title'=>_('Insufficient Access'), + 'type'=>'debug', + 'body'=>Debug::vars(array('required'=>$this->auth_required,'action'=>$this->request->action(),'user'=>Auth::instance()->get_user()->username)), + )); + + // @todo Login No Access redirects are not handled in JS? + if ($this->request->is_ajax()) { + echo _('You dont have enough permissions.'); + die(); + } else + HTTP::redirect('login/noaccess'); + + } else { + Session::instance()->set('afterlogin',Request::detect_uri()); + HTTP::redirect($this->noauth_redirect); + } + } + + // For AJAX calls, we dont need to render the complete page. + if ($this->request->is_ajax()) { + $this->auto_render = FALSE; + return; + } + + // Bind our template meta variable + $this->meta = new Meta; + View::bind_global('meta',$this->meta); + + // Add our logo + Style::add(array( + 'type'=>'stdin', + 'data'=>'h1 span{background:url('.Config::logo_uri().') no-repeat;}', + )); + + // Our default script(s) + foreach (array('file'=>array_reverse(array( + 'js/jquery-1.6.4.min.js', + 'js/jquery.jstree-1.0rc3.js', + 'js/jquery.cookie.js', + ))) as $type => $datas) { + + foreach ($datas as $data) { + Script::add(array( + 'type'=>$type, + 'data'=>$data, + ),TRUE); + } + } + + // Initialise our content + $this->template->left = ''; + $this->template->content = ''; + $this->template->right = ''; + } + + public function after() { + if (! is_string($this->template) AND empty($this->template->content)) + $this->template->content = Block::factory(); + + if ($this->auto_render) { + // Application Title + if ($mo=ORM::factory('Module',array('name'=>Request::current()->controller())) AND $mo->loaded()) + $this->meta->title = sprintf('%s: %s',Kohana::$config->load('config')->appname,$mo->display('name')); + else + $this->meta->title = Kohana::$config->load('config')->appname; + $this->template->title = ''; + + // Language + $this->meta->language = Config::language(); + + // Description + $this->meta->description = sprintf('%s::%s',$this->request->controller(),$this->request->action()); + + // Link images on the header line + $this->template->headimages = $this->_headimages(); + + // System Messages line + $this->template->sysmsg = $this->_sysmsg(); + + // Left Item + $this->template->left = $this->_left(); + + // Right Item + $this->template->right = $this->_right(); + + // Footer + $this->template->footer = $this->_footer(); + + // For any ajax rendered actions, we'll need to capture the content and put it in the response + } 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('
    %s
    ',$s)); + + // In case there any style sheets for this render. + $this->response->bodyadd(Style::factory()); + + // 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('
    %s
    ',$this->template->content)); + } + + parent::after(); + + // Generate and check the ETag for this file + if (Kohana::$environment === Kohana::PRODUCTION OR Kohana::$config->load('debug')->etag) + $this->check_cache(sha1($this->response->body())); + } + + /** + * Default Method to call from the tree menu + */ + public function action_menu() { + $this->template->content = _('Please choose from the menu on the left - you may need to expand the items by pressing on the plus.'); + } + + protected function _headimages() { + HeadImages::add(array( + 'url'=>'http://dev.leenooks.net', + 'img'=>'img/forum-big.png', + 'attrs'=>array('onclick'=>"target='_blank';",'title'=>'Link') + )); + + return HeadImages::factory(); + } + + protected function _sysmsg() { + return SystemMessage::factory(); + } + + protected function _left() { + return empty($this->template->left) ? Controller_Tree::js() : $this->template->left; + } + + protected function _right() { + return empty($this->template->right) ? '' : $this->template->right; + } + + public function _footer() { + return sprintf('© %s',Config::sitename()); + } + + /** + * Generate a view path to help View::factory() calls + * + * The purpose of this method is to ensure that we have a consistant + * layout for our view files, including those that are needed by + * plugins + * + * @param string Plugin Name (optional) + */ + public function viewpath($plugin='') { + $request = Request::current(); + + $path = $request->controller(); + + if ($request->directory()) + $path .= ($path ? '/' : '').$request->directory(); + + if ($plugin) + $path .= ($path ? '/' : '').$plugin; + + $path .= ($path ? '/' : '').$request->action(); + + return strtolower($path); + } +} +?> diff --git a/modules/lnApp/classes/lnApp/Controller/Tree.php b/modules/lnApp/classes/lnApp/Controller/Tree.php new file mode 100644 index 0000000..85cd554 --- /dev/null +++ b/modules/lnApp/classes/lnApp/Controller/Tree.php @@ -0,0 +1,116 @@ +response->headers('Content-Type','application/json'); + $this->response->body(json_encode($this->output)); + + parent::after(); + } + + public static function js() { + $mediapath = Route::get(static::$jsmediaroute); + + return ' +
    +'; + } + + /** + * Draw the Tree Menu + * + * The incoming ID is either a Branch B_x or a Node N_x + * Where X is actually the module. + * + * @param array $data Tree data passed in by inherited methods + */ + public function action_json(array $data=array()) { + if ($this->_auth_required() AND ! Auth::instance()->logged_in()) { + $this->output = array('attr'=>array('id'=>'a_login'), + 'data'=>array('title'=>_('Please Login').'...','attr'=>array('id'=>'N_login','href'=>URL::site('login')))); + + return; + } + + $this->output = array(); + + foreach ($data as $branch) { + array_push($this->output,array( + 'attr'=>array('id'=>sprintf('B_%s',$branch['id'])), + 'state'=>$branch['state'], + 'data'=>array('title'=>$branch['name']), + 'attr'=>array('id'=>sprintf('N_%s',$branch['id']),'href'=>empty($branch['attr_href']) ? URL::link('user',$branch['name'].'/menu',TRUE) : $branch['attr_href']), + ) + ); + } + } +} +?> diff --git a/modules/lnApp/classes/lnApp/HTML.php b/modules/lnApp/classes/lnApp/HTML.php new file mode 100644 index 0000000..920eda5 --- /dev/null +++ b/modules/lnApp/classes/lnApp/HTML.php @@ -0,0 +1,20 @@ + diff --git a/modules/lnApp/classes/lnApp/HTMLRender.php b/modules/lnApp/classes/lnApp/HTMLRender.php new file mode 100644 index 0000000..fb3e897 --- /dev/null +++ b/modules/lnApp/classes/lnApp/HTMLRender.php @@ -0,0 +1,91 @@ +get_called_class())); + } + + /** + * Add an item to be rendered + * + * @param array Item to be added + */ + public static function add($item,$prepend=FALSE) { + foreach (static::$_required_keys as $key) + if (! isset($item[$key])) + throw new Kohana_Exception('Missing key :key for image',array(':key'=>$key)); + + // Check for unique keys + if (static::$_unique_vals) + foreach (static::$_unique_vals as $v=>$u) + foreach (static::$_data as $d) + if (isset($d[$u]) && $d['data'] == $item['data']) + return; + + if ($prepend) + array_unshift(static::$_data,$item); + else + array_push(static::$_data,$item); + } + + /** + * Set the space used between rendering output + */ + public static function setSpacer($spacer) { + static::$_spacer = $spacer; + } + + /** + * Set the Kohana Media Path, used to determine where to find additional + * HTML content required for rendering. + */ + public static function setMediaPath($path) { + static::$_media_path = $path; + } + + /** + * Factory instance method must be declared by the child class + */ + public static function factory() { + throw new Kohana_Exception(':class is calling :method, when it should have its own method', + array(':class'=>get_called_class(),':method'=>__METHOD__)); + } + + /** + * Return the HTML to render the header images + */ + public function __toString() { + try { + return static::render(); + } + + // Display the exception message + catch (Exception $e) { + Kohana_Exception::handler($e); + } + } + + /** + * Rendering must be declared by the child class + */ + protected function render() { + throw new Kohana_Exception(':class is calling :method, when it should have its own method', + array(':class'=>get_called_class(),':method'=>__METHOD__)); + } +} +?> diff --git a/modules/lnApp/classes/lnApp/HeadImages.php b/modules/lnApp/classes/lnApp/HeadImages.php new file mode 100644 index 0000000..26c8199 --- /dev/null +++ b/modules/lnApp/classes/lnApp/HeadImages.php @@ -0,0 +1,47 @@ +uri(array('file'=>$value['img'])),array('alt'=>isset($value['attrs']['title']) ? $value['attrs']['title'] : '')); + if (isset($value['url'])) + $output .= HTML::anchor($value['url'],$i,(isset($value['attrs']) && is_array($value['attrs'])) ? $value['attrs'] : NULL); + else + $output .= $i; + $output .= static::$_spacer; + } + + return $output; + } +} +?> diff --git a/modules/lnApp/classes/lnApp/Meta.php b/modules/lnApp/classes/lnApp/Meta.php new file mode 100644 index 0000000..36df856 --- /dev/null +++ b/modules/lnApp/classes/lnApp/Meta.php @@ -0,0 +1,33 @@ +_array_keys) && empty($this->_data[$key])) + return array(); + + if (empty($this->_data[$key])) + return NULL; + else + return $this->_data[$key]; + } + + public function __set($key,$value) { + if (in_array($key,$this->_array_keys) && ! is_array($value)) + throw new Kohana_Exception('Key :key must be an array',array(':key'=>$key)); + + $this->_data[$key] = $value; + } +} +?> diff --git a/modules/lnApp/classes/lnApp/PWgen.php b/modules/lnApp/classes/lnApp/PWgen.php new file mode 100644 index 0000000..d6390b0 --- /dev/null +++ b/modules/lnApp/classes/lnApp/PWgen.php @@ -0,0 +1,35 @@ +load('pwgen')->host OR ! Kohana::$config->load('pwgen')->port) + throw new Kohana_Exception('No configuration for host or port (:host/:port)',array(':host'=>Kohana::$config->load('pwgen')->host,':port'=>Kohana::$config->load('pwgen')->port)); + + $ps = socket_create(AF_INET,SOCK_STREAM,0); + if (! socket_connect($ps,Kohana::$config->load('pwgen')->host,Kohana::$config->load('pwgen')->port)) + throw new Kohana_Exception('Unable to connect to password server'); + + // echo "Reading response:\n\n"; + $pw = ''; + while ($out = socket_read($ps,64)) + $pw .= rtrim($out); + + // echo "Closing socket..."; + socket_close ($ps); + + list($passwd,$passwdSay) = explode(' ',$pw); + // print " Password [$passwd] ($passwdSay) [$pw] ".md5($passwd)."
    "; + + return $pwonly ? $passwd : array('pw'=>$passwd,'say'=>$passwdSay); + } +} +?> diff --git a/modules/lnApp/classes/lnApp/Random.php b/modules/lnApp/classes/lnApp/Random.php new file mode 100644 index 0000000..47aa6b2 --- /dev/null +++ b/modules/lnApp/classes/lnApp/Random.php @@ -0,0 +1,17 @@ + diff --git a/modules/lnApp/classes/lnApp/Script.php b/modules/lnApp/classes/lnApp/Script.php new file mode 100644 index 0000000..301bba7 --- /dev/null +++ b/modules/lnApp/classes/lnApp/Script.php @@ -0,0 +1,64 @@ +'type'); + protected static $_rendered = FALSE; + + /** + * Return an instance of this class + * + * @return Script + */ + public static function factory() { + return new Script; + } + + /** + * Render the script tag + * + * @see HTMLRender::render() + */ + protected function render() { + $foutput = $soutput = ''; + $mediapath = Route::get(static::$_media_path); + + foreach (static::$_data as $value) { + switch ($value['type']) { + case 'file': + $foutput .= HTML::script($mediapath->uri(array('file'=>$value['data']))); + break; + case 'src': + $foutput .= HTML::script($value['data']); + break; + case 'stdin': + $soutput .= sprintf("",$value['data']); + break; + default: + throw new Kohana_Exception('Unknown style type :type',array(':type'=>$value['type'])); + } + } + + static::$_rendered = TRUE; + return $foutput.static::$_spacer.$soutput; + } + + public static function add($item,$prepend=FALSE,$x='') { + if (static::$_rendered) + throw new Kohana_Exception('Already rendered?'); + + return parent::add($item,$prepend); + } +} +?> diff --git a/modules/lnApp/classes/lnApp/Sort.php b/modules/lnApp/classes/lnApp/Sort.php new file mode 100644 index 0000000..4edef52 --- /dev/null +++ b/modules/lnApp/classes/lnApp/Sort.php @@ -0,0 +1,89 @@ +[a-zA-Z0-9])?)?,?)+$/',$sortby) || ! $data) + return; + + $code = '$c=0;'; + + foreach (explode(',',$sortby) as $key) { + $code .= 'if (is_object($a) || is_object($b)) {'; + foreach (array('a','b') as $x) { + $code .= 'if (is_array($'.$x.'->'.$key.')) {'; + $code .= 'asort($'.$x.'->'.$key.');'; + $code .= '$x'.$x.' = array_shift($'.$x.'->'.$key.');'; + $code .= '} else'; + $code .= '$x'.$x.' = $'.$x.'->'.$key.';'; + } + + $code .= 'if ($xa != $xb)'; + if ($rev) + $code .= 'return ($xa < $xb ? 1 : -1);'; + else + $code .= 'return ($xa > $xb ? 1 : -1);'; + + $code .= '} else {'; + + foreach (array('a','b') as $x) + $code .= '$'.$x.' = array_change_key_case($'.$x.');'; + + $key = strtolower($key); + + $code .= 'if ((! isset($a[\''.$key.'\'])) && isset($b[\''.$key.'\'])) return 1;'; + $code .= 'if (isset($a[\''.$key.'\']) && (! isset($b[\''.$key.'\']))) return -1;'; + + $code .= 'if ((isset($a[\''.$key.'\'])) && (isset($b[\''.$key.'\']))) {'; + foreach (array('a','b') as $x) { + $code .= 'if (is_array($'.$x.'[\''.$key.'\'])) {'; + $code .= 'asort($'.$x.'[\''.$key.'\']);'; + $code .= '$x'.$x.' = array_shift($'.$x.'[\''.$key.'\']);'; + $code .= '} else'; + $code .= '$x'.$x.' = $'.$x.'[\''.$key.'\'];'; + } + + $code .= 'if ($xa != $xb)'; + $code .= 'if (is_numeric($xa) && is_numeric($xb)) {'; + + if ($rev) + $code .= 'return ($xa < $xb ? 1 : -1);'; + else + $code .= 'return ($xa > $xb ? 1 : -1);'; + + $code .= '} else {'; + + if ($rev) + $code .= 'if (($c = strcasecmp($xb,$xa)) != 0) return $c;'; + else + $code .= 'if (($c = strcasecmp($xa,$xb)) != 0) return $c;'; + + $code .= '}}}'; + } + + $code .= 'return $c;'; + + $result = create_function('$a, $b',$code); + + uasort($data,$result); + } +} +?> diff --git a/modules/lnApp/classes/lnApp/Style.php b/modules/lnApp/classes/lnApp/Style.php new file mode 100644 index 0000000..150e90b --- /dev/null +++ b/modules/lnApp/classes/lnApp/Style.php @@ -0,0 +1,53 @@ +'type'); + + /** + * Return an instance of this class + * + * @return Style + */ + public static function factory() { + return new Style; + } + + /** + * Render the style tag + * + * @see HTMLRender::render() + */ + protected function render() { + $foutput = $soutput = ''; + $mediapath = Route::get(static::$_media_path); + + foreach (static::$_data as $value) { + switch ($value['type']) { + case 'file': + $foutput .= HTML::style($mediapath->uri(array('file'=>$value['data'])), + array('media'=>(! empty($value['media'])) ? $value['media'] : 'screen'),TRUE); + break; + case 'stdin': + $soutput .= sprintf("",$value['data']); + break; + default: + throw new Kohana_Exception('Unknown style type :type',array(':type'=>$value['type'])); + } + } + + return $foutput.static::$_spacer.$soutput; + } +} +?> diff --git a/modules/lnApp/classes/lnApp/SystemMessage.php b/modules/lnApp/classes/lnApp/SystemMessage.php new file mode 100644 index 0000000..5f827c4 --- /dev/null +++ b/modules/lnApp/classes/lnApp/SystemMessage.php @@ -0,0 +1,128 @@ + '; + protected static $_required_keys = array('title','body','type'); + + /** + * Add a system message to be rendered + * + * @param array System Message attributes + */ + public static function add($msg,$prepend=FALSE) { + if ($msgs = Session::instance()->get('sessionmsgs')) { + static::$_data = $msgs; + } + + parent::add($msg); + + // Add a gribber popup + Style::add(array( + 'type'=>'file', + 'data'=>'css/jquery.gritter.css', + 'media'=>'screen', + )); + Script::add(array( + 'type'=>'file', + 'data'=>'js/jquery.gritter-1.5.js', + )); + Script::add(array( + 'type'=>'stdin', + 'data'=>sprintf( +'$(document).ready(function() { + $.extend($.gritter.options, { + fade_in_speed: "medium", + fade_out_speed: 2000, + time: "3000", + sticky: false, + }); + $.gritter.add({ + title: "%s", + text: "%s", + image: "%s", +});});',$msg['title'],$msg['body'],URL::site().static::image($msg['type'],true)))); + + // Save our messages in our session, so that we get them for redirects + Session::instance()->set('sessionmsgs',static::$_data); + } + + /** + * Return an instance of this class + * + * @return SystemMessage + */ + public static function factory() { + return new SystemMessage; + } + + /** + * Render an image for the System Message + */ + public static function image($type,$raw=false,$big=false,$alt='') { + $mediapath = Route::get(static::$_media_path); + + switch ($type) { + case 'error': + $file = sprintf('img/dialog-error%s.png',$big ? '-big' : ''); + break; + case 'info': + $file = sprintf('img/dialog-information%s.png',$big ? '-big' : ''); + break; + case 'warning': + $file = sprintf('img/dialog-warning%s.png',$big ? '-big' : ''); + break; + case 'debug': + $file = sprintf('img/dialog-question%s.png',$big ? '-big' : ''); + break; + default: + throw new Kohana_Exception('Unknown system message type :type',array(':type'=>$value['type'])); + } + + if ($raw) + return $mediapath->uri(array('file'=>$file)); + else + return HTML::image($mediapath->uri(array('file'=>$file)),array('alt'=>$alt ? $alt : '','class'=>'sysicon')); + } + + /** + * Render this system message + * + * @see HTMLRender::render() + */ + protected function render() { + $output = ''; + $mediapath = Route::get(static::$_media_path); + + // Reload our message from the session + if ($msgs = Session::instance()->get('sessionmsgs')) { + Session::instance()->delete('sessionmsgs'); + static::$_data = $msgs; + } + + $i = 0; + foreach (static::$_data as $value) { + if ($i++) + $output .= static::$_spacer; + + $output .= ''; + $output .= sprintf('',static::image($value['type'],false,false,isset($value['alt']) ? $value['alt'] : '')); + $output .= sprintf('',$value['title']); + $output .= ''; + $output .= sprintf('',$value['body']); + $output .= '
    %s%s
    %s
    '; + } + + return $output; + } +} +?> diff --git a/modules/lnApp/classes/lnApp/Table.php b/modules/lnApp/classes/lnApp/Table.php new file mode 100644 index 0000000..9fd92a7 --- /dev/null +++ b/modules/lnApp/classes/lnApp/Table.php @@ -0,0 +1,275 @@ +/',$key)) + eval("\$x = \$d->$key;"); + elseif (preg_match('/^__VALUE__$/',$key)) + $x = $d; + else + $x = $d->display($key); + + return $x; + } + + public static function display($data,$rows,array $cols,array $option) { + if (! (array)$data) + return ''; + + $pag = NULL; + $view = $output = $button = ''; + + if (isset($option['type']) AND $option['type']) + switch ($option['type']) { + case 'select': + $view = 'table/select'; + + if (! empty($option['button'])) + $button = implode('',$option['button']); + else + $button = Form::button('Submit','View/Edit',array('class'=>'form_button','type'=>'submit')); + + Script::add(array( + 'type'=>'stdin', + 'data'=>' +(function($) { + // Enable Range Selection + $.fn.enableCheckboxRangeSelection = function() { + var lastCheckbox = null; + var followOn = 0; + var $spec = this; + $spec.bind("click", function(e) { + if (lastCheckbox != null && e.shiftKey) { + x = y = 0; + if (followOn != 0) { + if ($spec.index(lastCheckbox) < $spec.index(e.target)) { + x = 1 - ((followOn == 1) ? 1 : 0); + } else { + y = 1 - ((followOn == -1) ? 1 : 0); + } + } + + $spec.slice( + Math.min($spec.index(lastCheckbox) - x, $spec.index(e.target)) + 1, + Math.max($spec.index(lastCheckbox), $spec.index(e.target)) + y + ).attr("checked",function() { return ! this.checked; }) + .parent().parent().toggleClass("selected"); + + followOn = ($spec.index(lastCheckbox) < $spec.index(e.target)) ? 1 : -1; + } else { + followOn = 0; + } + lastCheckbox = e.target; + }); + + return $spec; + }; + + // Enable Toggle, (De)Select All + $.fn.check = function(mode) { + // if mode is undefined, use "on" as default + var mode = mode || "on"; + + switch(mode) { + case "on": + $("#select-table tr:not(.head)") + .filter(":has(:checkbox:not(checked))") + .toggleClass("selected") + break; + case "off": + $("#select-table tr:not(.head)") + .filter(":has(:checkbox:checked)") + .toggleClass("selected") + break; + case "toggle": + $("#select-table tr:not(.head)") + .toggleClass("selected"); + break; + } + + return this.each(function(e) { + switch(mode) { + case "on": + this.checked = true; + break; + case "off": + this.checked = false; + break; + case "toggle": + this.checked = !this.checked; + break; + } + }); + }; +})(jQuery); + +// Bind our actions +$(document).ready(function() { + $("#select-table :checkbox").enableCheckboxRangeSelection(); + $("#select-menu > #toggle").bind("click",function() { + $("#select-table :checkbox").check("toggle"); + }); + $("#select-menu > #all_on").bind("click",function() { + $("#select-table :checkbox").check("on"); + }); + $("#select-menu > #all_off").bind("click",function() { + $("#select-table :checkbox").check("off"); + }); + + // Our mouse over row highlight + $("#select-table tr:not(.head)").hover(function() { + $(this).children().toggleClass("highlight"); + }, + function() { + $(this).children().toggleClass("highlight"); + }); + + // Click to select Row + $("#select-table tr:not(.head)") + .filter(":has(:checkbox:checked)") + .addClass("selected") + .end() + .click(function(e) { + $(this).toggleClass("selected"); + if (e.target.type !== "checkbox") { + $(":checkbox", this).attr("checked", function() { + return !this.checked; + }); + } + }); + + // Double click to select a row + $("#select-table tr:not(.head)") + .dblclick(function(e) { + window.location = $("a", this).attr("href"); + }); +}); + ')); + + $output .= Form::open((isset($option['form']) ? $option['form'] : '')); + + if (! empty($option['hidden'])) + $output .= '
    '.implode('',$option['hidden']).'
    '; + + break; + + case 'list': + default: + Script::add(array( + 'type'=>'stdin', + 'data'=>' +// Bind our actions +$(document).ready(function() { + // Our mouse over row highlight + $("#list-table tr:not(.head)").hover(function() { + $(this).children().toggleClass("highlight"); + }, + function() { + $(this).children().toggleClass("highlight"); + }); +}); + ')); + } + + If (! $view) + $view = 'table/list'; + + if (isset($option['page']) AND $option['page']) { + $pag = new Pagination(array( + 'total_items'=>count($data), + 'items_per_page'=>$rows, + )); + + $output .= (string)$pag; + } + + $other = $i = 0; + $td = $th = array(); + foreach ($cols as $col => $details) { + $th[$col] = isset($details['label']) ? $details['label'] : ''; + $td[$col]['class'] = isset($details['class']) ? $details['class'] : ''; + $td[$col]['url'] = isset($details['url']) ? $details['url'] : ''; + } + + $output .= View::factory($view.'_head') + ->set('th',array_values($th)); + + foreach ($data as $do) { + if ($pag) { + if (++$i < $pag->current_first_item()) + continue; + elseif ($i > $pag->current_last_item()) + break; + } + + if ($pag OR ($i++ < $rows) OR is_null($rows)) { + foreach (array_keys($cols) as $col) + $td[$col]['value'] = Table::resolve($do,$col); + + $output .= View::factory($view.'_body') + ->set('td',$td); + + } elseif (isset($option['show_other']) AND ($col=$option['show_other'])) { + $other += Table::resolve($do,$col); + } + } + + if ($other) + $output .= View::factory($view.'_xtra') + ->set('td',array_values($cols)) + ->set('count',$i-$rows) + ->set('other',$other); + + $output .= View::factory($view.'_foot') + ->set('button',$button); + + if (isset($option['type']) AND $option['type']) + switch ($option['type']) { + case 'select': + $output .= Form::close(); + } + + return $output; + } + + public static function post($key,$i='id') { + if (isset($_POST[$i])) + Session::instance()->set('page_table_view'.$key,$_POST[$i]); + } + + public static function page($key) { + // We have preference for parameters passed to the action. + if (is_null($id = Request::current()->param('id'))) { + + if (isset($_POST['id']) AND is_array($_POST['id'])) + Table::post($key,'id'); + + if ($ids = Session::instance()->get('page_table_view'.$key)) { + $pag = new Pagination(array( + 'total_items'=>count($ids), + 'items_per_page'=>1, + )); + + return array($ids[$pag->current_first_item()-1],(string)$pag); + } + + } + + // If we get here, then there is no previous data to retrieve. + return array($id,''); + } +} +?> diff --git a/modules/lnApp/media/theme/lnapp/images/breadcrumb_divider.png b/modules/lnApp/media/theme/lnapp/images/breadcrumb_divider.png new file mode 100644 index 0000000..af777f9 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/breadcrumb_divider.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/btn_submit.png b/modules/lnApp/media/theme/lnapp/images/btn_submit.png new file mode 100644 index 0000000..1266df5 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/btn_submit.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/btn_submit_2.png b/modules/lnApp/media/theme/lnapp/images/btn_submit_2.png new file mode 100644 index 0000000..3ca184b Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/btn_submit_2.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/btn_view_site.png b/modules/lnApp/media/theme/lnapp/images/btn_view_site.png new file mode 100644 index 0000000..02ffad8 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/btn_view_site.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/header_shadow.png b/modules/lnApp/media/theme/lnapp/images/header_shadow.png new file mode 100644 index 0000000..a1b8645 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/header_shadow.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_add_user.png b/modules/lnApp/media/theme/lnapp/images/icn_add_user.png new file mode 100644 index 0000000..ef0e209 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_add_user.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_audio.png b/modules/lnApp/media/theme/lnapp/images/icn_audio.png new file mode 100644 index 0000000..0e1fd37 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_audio.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_categories.png b/modules/lnApp/media/theme/lnapp/images/icn_categories.png new file mode 100644 index 0000000..330e20f Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_categories.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_edit.png b/modules/lnApp/media/theme/lnapp/images/icn_edit.png new file mode 100644 index 0000000..be8c68f Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_edit.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_edit_article.png b/modules/lnApp/media/theme/lnapp/images/icn_edit_article.png new file mode 100644 index 0000000..5a7e2c2 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_edit_article.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_folder.png b/modules/lnApp/media/theme/lnapp/images/icn_folder.png new file mode 100644 index 0000000..03e4057 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_folder.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_jump_back.png b/modules/lnApp/media/theme/lnapp/images/icn_jump_back.png new file mode 100644 index 0000000..8cc4a68 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_jump_back.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_logout.png b/modules/lnApp/media/theme/lnapp/images/icn_logout.png new file mode 100644 index 0000000..ea274c5 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_logout.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_new_article.png b/modules/lnApp/media/theme/lnapp/images/icn_new_article.png new file mode 100644 index 0000000..23f57f7 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_new_article.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_photo.png b/modules/lnApp/media/theme/lnapp/images/icn_photo.png new file mode 100644 index 0000000..bf27b52 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_photo.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_profile.png b/modules/lnApp/media/theme/lnapp/images/icn_profile.png new file mode 100644 index 0000000..1821d29 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_profile.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_search.png b/modules/lnApp/media/theme/lnapp/images/icn_search.png new file mode 100644 index 0000000..f362e30 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_search.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_security.png b/modules/lnApp/media/theme/lnapp/images/icn_security.png new file mode 100644 index 0000000..ac0adbf Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_security.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_settings.png b/modules/lnApp/media/theme/lnapp/images/icn_settings.png new file mode 100644 index 0000000..dfb5526 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_settings.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_tags.png b/modules/lnApp/media/theme/lnapp/images/icn_tags.png new file mode 100644 index 0000000..544a958 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_tags.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_trash.png b/modules/lnApp/media/theme/lnapp/images/icn_trash.png new file mode 100644 index 0000000..675820f Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_trash.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_user.png b/modules/lnApp/media/theme/lnapp/images/icn_user.png new file mode 100644 index 0000000..955dce3 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_user.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_video.png b/modules/lnApp/media/theme/lnapp/images/icn_video.png new file mode 100644 index 0000000..2a06544 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_video.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/icn_view_users.png b/modules/lnApp/media/theme/lnapp/images/icn_view_users.png new file mode 100644 index 0000000..46148d5 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/icn_view_users.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/module_footer_bg.png b/modules/lnApp/media/theme/lnapp/images/module_footer_bg.png new file mode 100644 index 0000000..ace02f3 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/module_footer_bg.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/old/icn_alert_error.png b/modules/lnApp/media/theme/lnapp/images/old/icn_alert_error.png new file mode 100644 index 0000000..00461c8 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/old/icn_alert_error.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/old/icn_alert_info.png b/modules/lnApp/media/theme/lnapp/images/old/icn_alert_info.png new file mode 100644 index 0000000..1be971d Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/old/icn_alert_info.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/old/icn_alert_warning.png b/modules/lnApp/media/theme/lnapp/images/old/icn_alert_warning.png new file mode 100644 index 0000000..53f545a Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/old/icn_alert_warning.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/post_message.png b/modules/lnApp/media/theme/lnapp/images/post_message.png new file mode 100644 index 0000000..add5480 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/post_message.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/secondary_bar.png b/modules/lnApp/media/theme/lnapp/images/secondary_bar.png new file mode 100644 index 0000000..42dbf1f Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/secondary_bar.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/secondary_bar_shadow.png b/modules/lnApp/media/theme/lnapp/images/secondary_bar_shadow.png new file mode 100644 index 0000000..0f798df Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/secondary_bar_shadow.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/sidebar.png b/modules/lnApp/media/theme/lnapp/images/sidebar.png new file mode 100644 index 0000000..7079be4 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/sidebar.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/sidebar_divider.png b/modules/lnApp/media/theme/lnapp/images/sidebar_divider.png new file mode 100644 index 0000000..e92be13 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/sidebar_divider.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/sidebar_shadow.png b/modules/lnApp/media/theme/lnapp/images/sidebar_shadow.png new file mode 100644 index 0000000..15226a8 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/sidebar_shadow.png differ diff --git a/modules/lnApp/media/theme/lnapp/images/table_sorter_header.png b/modules/lnApp/media/theme/lnapp/images/table_sorter_header.png new file mode 100644 index 0000000..381778d Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/images/table_sorter_header.png differ diff --git a/modules/lnApp/media/theme/lnapp/img/header_bg.png b/modules/lnApp/media/theme/lnapp/img/header_bg.png new file mode 100644 index 0000000..1e07357 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/img/header_bg.png differ diff --git a/modules/lnApp/media/theme/lnapp/img/icn_alert_error-big.png b/modules/lnApp/media/theme/lnapp/img/icn_alert_error-big.png new file mode 100644 index 0000000..49ed530 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/img/icn_alert_error-big.png differ diff --git a/modules/lnApp/media/theme/lnapp/img/icn_alert_error.png b/modules/lnApp/media/theme/lnapp/img/icn_alert_error.png new file mode 100644 index 0000000..f805012 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/img/icn_alert_error.png differ diff --git a/modules/lnApp/media/theme/lnapp/img/icn_alert_info-big.png b/modules/lnApp/media/theme/lnapp/img/icn_alert_info-big.png new file mode 100644 index 0000000..cca5804 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/img/icn_alert_info-big.png differ diff --git a/modules/lnApp/media/theme/lnapp/img/icn_alert_info.png b/modules/lnApp/media/theme/lnapp/img/icn_alert_info.png new file mode 100644 index 0000000..00accf1 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/img/icn_alert_info.png differ diff --git a/modules/lnApp/media/theme/lnapp/img/icn_alert_success.png b/modules/lnApp/media/theme/lnapp/img/icn_alert_success.png new file mode 100644 index 0000000..d72f09e Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/img/icn_alert_success.png differ diff --git a/modules/lnApp/media/theme/lnapp/img/icn_alert_warning-big.png b/modules/lnApp/media/theme/lnapp/img/icn_alert_warning-big.png new file mode 100644 index 0000000..a9ff09b Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/img/icn_alert_warning-big.png differ diff --git a/modules/lnApp/media/theme/lnapp/img/icn_alert_warning.png b/modules/lnApp/media/theme/lnapp/img/icn_alert_warning.png new file mode 100644 index 0000000..63b08f9 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/img/icn_alert_warning.png differ diff --git a/modules/lnApp/media/theme/lnapp/img/page_bg.png b/modules/lnApp/media/theme/lnapp/img/page_bg.png new file mode 100644 index 0000000..58ff604 Binary files /dev/null and b/modules/lnApp/media/theme/lnapp/img/page_bg.png differ diff --git a/modules/lnApp/media/theme/lnapp/index.html b/modules/lnApp/media/theme/lnapp/index.html new file mode 100644 index 0000000..8749e7b --- /dev/null +++ b/modules/lnApp/media/theme/lnapp/index.html @@ -0,0 +1,351 @@ + + + + + + Dashboard I Admin Panel + + + + + + + + + + + + + + + + + +
    +
    +

    John Doe (3 Messages)

    + +
    + +
    + + + +
    + +

    Welcome to the free MediaLoot admin panel template, this could be an informative message.

    + +
    +

    Stats

    +
    +
    + +
    + +
    +
    +

    Today

    +

    1,876

    +

    Hits

    +

    2,103

    +

    Views

    +
    +
    +

    Yesterday

    +

    1,646

    +

    Hits

    +

    2,054

    +

    Views

    +
    +
    +
    +
    +
    + +
    +

    Content Manager

    + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Entry NameCategoryCreated OnActions
    Lorem Ipsum Dolor Sit AmetArticles5th April 2011
    Ipsum Lorem Dolor Sit AmetFreebies6th April 2011
    Sit Amet Dolor IpsumTutorials10th April 2011
    Dolor Lorem AmetArticles16th April 2011
    Dolor Lorem AmetArticles16th April 2011
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CommentPosted byPosted OnActions
    Lorem Ipsum Dolor Sit AmetMark Corrigan5th April 2011
    Ipsum Lorem Dolor Sit AmetJeremy Usbourne6th April 2011
    Sit Amet Dolor IpsumSuper Hans10th April 2011
    Dolor Lorem AmetAlan Johnson16th April 2011
    Dolor Lorem AmetDobby16th April 2011
    + +
    + +
    + +
    + +
    +

    Messages

    +
    +
    +

    Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor.

    +

    John Doe

    +

    Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor.

    +

    John Doe

    +

    Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor.

    +

    John Doe

    +

    Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor.

    +

    John Doe

    +

    Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor.

    +

    John Doe

    +
    +
    +
    +
    + + +
    +
    +
    + +
    + +
    +

    Post New Article

    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + +
    +
    + +

    A Warning Alert

    + +

    An Error Message

    + +

    A Success Message

    + +
    +

    Basic Styles

    +
    +

    Header 1

    +

    Header 2

    +

    Header 3

    +

    Header 4

    +

    Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras mattis consectetur purus sit amet fermentum. Maecenas faucibus mollis interdum. Maecenas faucibus mollis interdum. Cras justo odio, dapibus ac facilisis in, egestas eget quam.

    + +

    Donec id elit non mi porta link text gravida at eget metus. Donec ullamcorper nulla non metus auctor fringilla. Cras mattis consectetur purus sit amet fermentum. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    + +
      +
    • Donec ullamcorper nulla non metus auctor fringilla.
    • +
    • Cras mattis consectetur purus sit amet fermentum.
    • +
    • Donec ullamcorper nulla non metus auctor fringilla.
    • +
    • Cras mattis consectetur purus sit amet fermentum.
    • +
    +
    +
    +
    +
    + + + + + \ No newline at end of file diff --git a/modules/lnApp/media/theme/lnapp/js/hideshow.js b/modules/lnApp/media/theme/lnapp/js/hideshow.js new file mode 100644 index 0000000..aee6950 --- /dev/null +++ b/modules/lnApp/media/theme/lnapp/js/hideshow.js @@ -0,0 +1,39 @@ +// Andy Langton's show/hide/mini-accordion @ http://andylangton.co.uk/jquery-show-hide + +// this tells jquery to run the function below once the DOM is ready +$(document).ready(function() { + +// choose text for the show/hide link - can contain HTML (e.g. an image) +var showText='Show'; +var hideText='Hide'; + +// initialise the visibility check +var is_visible = false; + +// append show/hide links to the element directly preceding the element with a class of "toggle" +$('.toggle').prev().append(' '+hideText+''); + +// hide all of the elements with a class of 'toggle' +$('.toggle').show(); + +// capture clicks on the toggle links +$('a.toggleLink').click(function() { + +// switch visibility +is_visible = !is_visible; + +// change the link text depending on whether the element is shown or hidden +if ($(this).text()==showText) { +$(this).text(hideText); +$(this).parent().next('.toggle').slideDown('slow'); +} +else { +$(this).text(showText); +$(this).parent().next('.toggle').slideUp('slow'); +} + +// return false so any link destination is not followed +return false; + +}); +}); \ No newline at end of file diff --git a/modules/lnApp/media/theme/lnapp/js/jquery.equalHeight.js b/modules/lnApp/media/theme/lnapp/js/jquery.equalHeight.js new file mode 100644 index 0000000..0ceb3a6 --- /dev/null +++ b/modules/lnApp/media/theme/lnapp/js/jquery.equalHeight.js @@ -0,0 +1,25 @@ +// make sure the $ is pointing to JQuery and not some other library +(function($){ + // add a new method to JQuery + + $.fn.equalHeight = function() { + // find the tallest height in the collection + // that was passed in (.column) + lowest = tallest = 0; + adjust = 10; // Just to make it look a little neater (plus for some reason the footer stomps on the highest column + this.each(function() { + thisHeight = $(this).height(); + thisOffset = $(this).offset(); + if (thisOffset.top && thisHeight > tallest) + tallest = thisHeight; + if (thisOffset.top > lowest) + lowest = thisOffset.top; + }); + + // set each items height to use the tallest value found + this.each(function() { + thisOffset = $(this).offset(); + $(this).height(lowest-thisOffset.top+tallest+adjust); + }); + } +})(jQuery); diff --git a/modules/lnApp/media/theme/lnapp/js/jquery.tablesorter.min.js b/modules/lnApp/media/theme/lnapp/js/jquery.tablesorter.min.js new file mode 100644 index 0000000..b8605df --- /dev/null +++ b/modules/lnApp/media/theme/lnapp/js/jquery.tablesorter.min.js @@ -0,0 +1,4 @@ + +(function($){$.extend({tablesorter:new +function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}if(table.tBodies.length==0)return;var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function checkHeaderOptionsSortingLocked(table,i){if((table.config.headers[i])&&(table.config.headers[i].lockedOrder))return table.config.headers[i].lockedOrder;return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i b["+i+"]) ? 1 : 0));";};function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));";};function makeSortNumeric(i){return"a["+i+"]-b["+i+"];";};function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];";};function sortText(a,b){if(table.config.sortLocaleCompare)return a.localeCompare(b);return((ab)?1:0));};function sortTextDesc(a,b){if(table.config.sortLocaleCompare)return b.localeCompare(a);return((ba)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder)this.order=this.lockedOrder;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i + + + + <?php echo $meta->title; ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    +
    +
    + +
    +
    > +
    + + + + +
    +
    +
    +
    + + + + + +
    + + + + + +
    +
    +
    > +
    + + + + +
    +
    +
    +
    + + + + + = Kohana::STAGING) { ?> + + + +
    + + diff --git a/modules/lnApp/views/table/select_body.php b/modules/lnApp/views/table/select_body.php new file mode 100644 index 0000000..2d297d0 --- /dev/null +++ b/modules/lnApp/views/table/select_body.php @@ -0,0 +1,8 @@ + + + $details) { ?> + + + + + diff --git a/modules/lnApp/views/table/select_foot.php b/modules/lnApp/views/table/select_foot.php new file mode 100644 index 0000000..d70f080 --- /dev/null +++ b/modules/lnApp/views/table/select_foot.php @@ -0,0 +1,11 @@ + +
    +
    +
    + + + + +
    +
    +
    diff --git a/modules/lnApp/views/table/select_head.php b/modules/lnApp/views/table/select_head.php new file mode 100644 index 0000000..f246686 --- /dev/null +++ b/modules/lnApp/views/table/select_head.php @@ -0,0 +1,2 @@ + + diff --git a/modules/lnApp/views/table/select_xtra.php b/modules/lnApp/views/table/select_xtra.php new file mode 100644 index 0000000..a8c1fa7 --- /dev/null +++ b/modules/lnApp/views/table/select_xtra.php @@ -0,0 +1 @@ +
     ',$th); ?>
    Other