Merge from lnApp

This commit is contained in:
Deon George 2011-05-09 17:40:50 +10:00
parent 8814447096
commit 8b658b497a
46 changed files with 466 additions and 200 deletions

View File

@ -36,14 +36,6 @@ ini_set('unserialize_callback_func', 'spl_autoload_call');
//-- Configuration and initialization -----------------------------------------
/**
* Set Kohana::$environment if a 'KOHANA_ENV' environment variable has been supplied.
*/
if (getenv('KOHANA_ENV') !== FALSE)
{
Kohana::$environment = getenv('KOHANA_ENV');
}
/**
* Initialize Kohana, setting the default options.
*

View File

@ -0,0 +1,213 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides login capability
*
* @package lnApp
* @subpackage Page/Login
* @category Controllers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
* @also [logout]
*/
class Controller_lnApp_Login extends Controller_TemplateDefault {
public function action_index() {
// If user already signed-in
if (Auth::instance()->logged_in()!= 0) {
// Redirect to the user account
Request::instance()->redirect('welcome/index');
}
// If there is a post and $_POST is not empty
if ($_POST) {
// Store our details in a session key
Session::instance()->set('username',$_POST['username']);
Session::instance()->set('password',$_POST['password']);
// Instantiate a new user
$user = ORM::factory('account');
// Check Auth
$status = $user->login($_POST);
// If the post data validates using the rules setup in the user model
if ($status) {
// Redirect to the user account
if ($redir = Session::instance()->get('afterlogin')) {
Session::instance()->delete('afterlogin');
Request::instance()->redirect($redir);
} else
Request::instance()->redirect('welcome/index');
} else {
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'),
));
$this->template->control = HTML::anchor($this->request->uri(),'Login',array('id'=>'ajxbody'));
$this->template->content = Block::factory();
Script::add(array('type'=>'stdin','data'=>'
$(document).ready(function() {
$("#ajxbody").click(function() {$("#ajBODY").load("'.$this->request->uri().'/"); return false;});
});'
));
}
public function action_register() {
// If user already signed-in
if (Auth::instance()->logged_in()!= 0) {
// Redirect to the user account
Request::instance()->redirect('welcome/index');
}
// Instantiate a new user
$account = ORM::factory('account');
// If there is a post and $_POST is not empty
if ($_POST) {
// Check Auth
$status = $account->values($_POST)->check();
if (! $status) {
foreach ($account->validate()->errors() as $f=>$r) {
// $r[0] has our reason for validation failure
switch ($r[0]) {
// Generic validation reason
default:
SystemMessage::add(array(
'title'=>_('Validation failed'),
'type'=>'error',
'body'=>sprintf(_('The defaults on your submission were not valid for field %s (%s).'),$f,$r[0])
));
}
}
}
$ido = ORM::factory('module')
->where('name','=','account')
->find();
$account->id = $ido->record_id->next_id($ido->id);
// Save the user details
if ($account->save()) {}
}
SystemMessage::add(array(
'title'=>_('Already have an account?'),
'type'=>'info',
'body'=>_('If you already have an account, please login..')
));
Block::add(array(
'title'=>_('Register'),
'body'=>View::factory('bregister')
->set('account',$account)
->set('errors',$account->validate()->errors()),
'style'=>array('css/bregister.css'=>'screen'),
));
$this->template->control = HTML::anchor($this->request->uri(),'Register',array('id'=>'ajxbody'));
$this->template->content = Block::factory();
$this->template->left = HTML::anchor('login','Login').'...';
}
/**
* Enable user password reset
*/
public function action_reset() {
// If user already signed-in
if (Auth::instance()->logged_in()!= 0) {
// Redirect to the user account
Request::instance()->redirect('welcome/index');
}
// If the user posted their details to reset their password
if ($_POST) {
// If the email address is correct, create a method token
if (! empty($_POST['email']) AND ($ao=ORM::factory('account',array('email'=>$_POST['email']))) AND $ao->loaded()) {
$mt = ORM::factory('module_method_token');
// Find out our password reset method id
// @todo move this to a more generic method, so that it can be called by other methods
$mo = ORM::factory('module',array('name'=>'account'));
$mmo = ORM::factory('module_method',array('name'=>'user_resetpassword','module_id'=>$mo->id));
// Check to see if there is already a token, if so, do nothing.
if ($mt->where('account_id','=',$ao->id)->and_where('method_id','=',$mmo->id)->find()) {
if ($mt->date_expire < time()) {
$mt->delete();
$mt->clear();
}
}
if (! $mt->loaded()) {
$mt->account_id = $ao->id;
$mt->method_id = $mmo->id;
$mt->date_expire = time() + 15*3600;
$mt->token = md5(sprintf('%s:%s:%s',$mt->account_id,$mt->method_id,$mt->date_expire));
$mt->save();
// Send our email with the token
$et = EmailTemplate::instance('account_reset_password');
$et->to = array($mt->account->email=>sprintf('%s %s',$mt->account->first_name,$mt->account->last_name));
$et->variables = array(
'SITE'=>URL::base(TRUE,TRUE),
'SITE_ADMIN'=>Config::sitename(),
'SITE_NAME'=>Config::sitename(),
'TOKEN'=>$mt->token,
'USER_NAME'=>sprintf('%s %s',$mt->account->first_name,$mt->account->last_name),
);
$et->send();
}
// Redirect to our password reset, the Auth will validate the token.
} elseif (! empty($_REQUEST['token'])) {
Request::instance()->redirect(sprintf('user/account/resetpassword?token=%s',$_REQUEST['token']));
}
// Show our token screen even if the email was invalid.
if (isset($_POST['email']))
Block::add(array(
'title'=>_('Reset your password'),
'body'=>View::factory('login_reset_sent'),
'style'=>array('css/login.css'=>'screen'),
));
else
Request::instance()->redirect('login');
} else {
Block::add(array(
'title'=>_('Reset your password'),
'body'=>View::factory('login_reset'),
'style'=>array('css/login.css'=>'screen'),
));
}
$this->template->content = Block::factory();
}
public function action_noaccess() {
$this->template->content = '&nbsp;';
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.')
));
}
}
?>

View File

@ -61,9 +61,9 @@ abstract class Controller_lnApp_TemplateDefault extends Controller_Template {
if (! Kohana::Config('config.method_security'))
return FALSE;
return (($this->auth_required !== FALSE && Auth::instance()->logged_in() === 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]) === FALSE));
Auth::instance()->logged_in($this->secure_actions[$this->request->action],get_class($this).'|'.__METHOD__) === FALSE));
}
/**

View File

@ -1,138 +1,4 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides login capability
*
* @package lnApp
* @subpackage Page/Login
* @category Controllers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
* @also [logout]
*/
class Controller_Login extends Controller_TemplateDefault {
public function action_index() {
// If user already signed-in
if (Auth::instance()->logged_in()!= 0) {
// Redirect to the user account
Request::instance()->redirect('welcome/index');
}
// If there is a post and $_POST is not empty
if ($_POST) {
// Store our details in a session key
Session::instance()->set('admin_name',$_POST['admin_name']);
Session::instance()->set('password',$_POST['password']);
// Instantiate a new user
$user = ORM::factory('account');
// Check Auth
$status = $user->login($_POST);
// If the post data validates using the rules setup in the user model
if ($status) {
// Redirect to the user account
if ($redir = Session::instance()->get('afterlogin')) {
Session::instance()->delete('afterlogin');
Request::instance()->redirect($redir);
} else
Request::instance()->redirect('welcome/index');
} else {
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'),
));
$this->template->control = HTML::anchor($this->request->uri(),'Login',array('id'=>'ajxbody'));
$this->template->content = Block::factory();
Script::add(array('type'=>'stdin','data'=>'
$(document).ready(function() {
$("#ajxbody").click(function() {$("#ajBODY").load("'.$this->request->uri().'/"); return false;});
});'
));
}
public function action_register() {
// If user already signed-in
if (Auth::instance()->logged_in()!= 0) {
// Redirect to the user account
Request::instance()->redirect('welcome/index');
}
// Instantiate a new user
$account = ORM::factory('account');
// If there is a post and $_POST is not empty
if ($_POST) {
// Check Auth
$status = $account->values($_POST)->check();
if (! $status) {
foreach ($account->validate()->errors() as $f=>$r) {
// $r[0] has our reason for validation failure
switch ($r[0]) {
// Generic validation reason
default:
SystemMessage::add(array(
'title'=>_('Validation failed'),
'type'=>'error',
'body'=>sprintf(_('The defaults on your submission were not valid for field %s (%s).'),$f,$r[0])
));
}
}
}
$ido = ORM::factory('module')
->where('name','=','account')
->find();
$account->id = $ido->record_id->next_id($ido->id);
// Save the user details
if ($account->save()) {}
}
SystemMessage::add(array(
'title'=>_('Already have an account?'),
'type'=>'info',
'body'=>_('If you already have an account, please login..')
));
Block::add(array(
'title'=>_('Register'),
'body'=>View::factory('bregister')
->set('account',$account)
->set('errors',$account->validate()->errors()),
'style'=>array('css/bregister.css'=>'screen'),
));
$this->template->control = HTML::anchor($this->request->uri(),'Register',array('id'=>'ajxbody'));
$this->template->content = Block::factory();
$this->template->left = HTML::anchor('login','Login').'...';
}
public function action_noaccess() {
$this->template->content = '&nbsp;';
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.')
));
}
}
class Controller_Login extends Controller_lnApp_Login {}
?>

View File

@ -55,7 +55,7 @@ class Database_TSM extends Database {
// Get user login details from user session - these are set by login
if (! $username)
$username = Session::instance()->get_once('admin_name');
$username = Session::instance()->get_once('username');
if (! $password)
$password = Session::instance()->get_once('password');

View File

@ -12,39 +12,6 @@
* @license http://dev.leenooks.net/license.html
*/
abstract class lnApp_Config extends Kohana {
/**
* Find a list of all database enabled modules
*
* @uses cache
*/
public static function appmodules() {
$cacheable = TRUE;
if (array_key_exists('cache',Kohana::modules())) {
$cache = Cache::instance(static::cachetype());
if ($cacheable AND $cache->get('modules'))
return $cache->get('modules');
} else
$cache = '';
$modules = array();
$module_table = 'module';
if (class_exists('Model_'.ucfirst($module_table))) {
$mo = ORM::factory($module_table)->where('status','=',1)->find_all()->as_array();
foreach ($mo as $o)
$modules[$o->name] = MODPATH.$o->name;
}
if ($cache)
$cache->set('modules',$modules);
return $modules;
}
/**
* Return our site name
*/
@ -90,7 +57,13 @@ abstract class lnApp_Config extends Kohana {
return Kohana::config('config.site_name');
}
public static function logo_file() {
// @todo Move the logo filename to a config file
return Kohana::find_file(sprintf('media/%s',Config::siteid()),'img/logo-small','png');
}
public static function logo() {
// @todo Move the logo filename to a config file
$mediapath = Route::get('default/media');
$logo = $mediapath->uri(array('file'=>'img/logo-small.png'),array('alt'=>static::sitename()));

View File

@ -51,13 +51,13 @@ class Model_Auth_UserDefault extends Model_Auth_User {
* @return boolean
*/
public function login(array & $array, $redirect = FALSE) {
$fieldname = 'admin_name';
$fieldname = 'admin_name'; // @todo This should be defined in a config or database driver file
$array = Validate::factory($array)
->label('admin_name', $this->_labels[$fieldname])
->label('username', $this->_labels[$fieldname])
->label('password', $this->_labels['password'])
->filter(TRUE, 'trim')
->filter('admin_name','strtoupper')
->rules('admin_name', $this->_rules[$fieldname])
->filter('username','strtoupper')
->rules('username', $this->_rules[$fieldname])
->rules('password', $this->_rules['password']);
// Get the remember login option
@ -69,7 +69,7 @@ class Model_Auth_UserDefault extends Model_Auth_User {
if ($array->check())
{
// Attempt to load the user
$this->where($fieldname, '=', $array['admin_name'])->find();
$this->where($fieldname, '=', $array['username'])->find();
if ($this->loaded() AND Auth::instance()->login($this, $array['password'], $remember))
{

View File

@ -13,7 +13,7 @@
class TSM {
public function set($username,$password,Database_TSM_Result $server) {
// @todo Consider encrypting this
Session::instance()->set('admin_name',$username);
Session::instance()->set('username',$username);
Session::instance()->set('password',$password);
Session::instance()->set('SERVER',$server);

View File

@ -12,18 +12,11 @@
*/
return array(
'driver' => 'ORM',
'hash_method' => 'sha1',
'salt_pattern' => '1, 3, 5, 9, 14, 15, 20, 21, 28, 30',
'lifetime' => 1209600,
'session_key' => 'admin_name',
'forced_key' => 'auth_forced',
// Username/password combinations for the Auth File driver
'users' => array(
// 'admin' => 'b3154acf3a344170077d11bdb5fff31532f679a1919e716a02',
),
'driver' => 'ORM',
'hash_method' => 'sha1',
'salt_pattern' => '1, 3, 5, 9, 14, 15, 20, 21, 28, 30',
'lifetime' => 1209600,
'session_key' => 'username',
'forced_key' => 'auth_forced',
);
?>

View File

@ -0,0 +1,2 @@
order allow,deny
deny from all

View File

@ -1,10 +1,13 @@
/* Default Template CSS */
table.box-full { border: 1px solid #AAAACC; margin-right: auto; width: 100%; }
table.box-left { border: 1px solid #AAAACC; margin-right: auto; }
table.box-center { border: 1px solid #AAAACC; margin-left: auto; margin-right: auto; }
table.box-full { border: 1px solid #AAAACC; margin-right: auto; width: 100%; }
tr.head { font-weight: bold; }
td.head { font-weight: bold; }
td.bold { font-weight: bold; }
td.bold-right { font-weight: bold; text-align: right; }
td.right { text-align: right; }
tr.odd { background-color: #FCFCFE; }
tr.even { background-color: #F6F6F8; }

View File

@ -0,0 +1,92 @@
/* ie6 trash */
* html #gritter-notice-wrapper {
position:absolute;
}
* html .gritter-top {
margin-bottom:-10px;
}
* html .gritter-item {
padding-bottom:0;
}
* html .gritter-bottom {
margin-bottom:0;
}
* html .gritter-close {
background:url(../img/jquery.gritter-close-ie6.gif);
width:22px;
height:22px;
top:7px;
left:7px;
}
/* the norm */
#gritter-notice-wrapper {
position:fixed;
top:20px;
right:20px;
width:301px;
z-index:9999;
}
.gritter-item-wrapper {
position:relative;
margin:0 0 10px 0;
}
.gritter-top {
background:url(../img/jquery.gritter.png) no-repeat left -30px;
height:10px;
}
.hover .gritter-top {
background-position:right -30px;
}
.gritter-bottom {
background:url(../img/jquery.gritter.png) no-repeat left bottom;
height:8px;
margin:0;
}
.hover .gritter-bottom {
background-position: bottom right;
}
.gritter-item {
display:block;
background:url(../img/jquery.gritter.png) no-repeat left -40px;
color:#eee;
padding:2px 11px 8px 11px;
font-size: 11px;
font-family:verdana;
}
.hover .gritter-item {
background-position:right -40px;
}
.gritter-item p {
padding:0;
margin:0;
}
.gritter-close {
position:absolute;
top:5px;
left:3px;
background:url(../img/jquery.gritter.png) no-repeat left top;
cursor:pointer;
width:30px;
height:30px;
}
.gritter-title {
font-size:14px;
font-weight:bold;
padding:0 0 7px 0;
display:block;
text-shadow:1px 1px #000; /* Not supported by IE :( */
}
.gritter-image {
width:24px;
height:24px;
float:left;
}
.gritter-with-image,
.gritter-without-image {
padding:0 0 0px 0;
}
.gritter-with-image {
width:250px;
float:right;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

BIN
application/media/img/gritter.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 B

View File

@ -0,0 +1,21 @@
(function($){$.gritter={};$.gritter.options={fade_in_speed:'medium',fade_out_speed:2000,time:6000}
$.gritter.add=function(params){try{if(!params.title||!params.text){throw'You need to fill out the first 2 params: "title" and "text"';}}catch(e){alert('Gritter Error: '+e);}
return Gritter.add(params);}
$.gritter.remove=function(id,params){Gritter.removeSpecific(id,params||'');}
$.gritter.removeAll=function(params){Gritter.stop(params||'');}
var Gritter={fade_in_speed:'',fade_out_speed:'',time:'',_custom_timer:0,_item_count:0,_is_setup:0,_tpl_close:'<div class="gritter-close"></div>',_tpl_item:'<div id="gritter-item-[[number]]" class="gritter-item-wrapper" style="display:none"><div class="gritter-top"></div><div class="gritter-item">[[image]]<div class="[[class_name]]"><span class="gritter-title">[[username]]</span><p>[[text]]</p></div><div style="clear:both"></div></div><div class="gritter-bottom"></div></div>',_tpl_wrap:'<div id="gritter-notice-wrapper"></div>',add:function(params){if(!this._is_setup){this._runSetup();}
var user=params.title,text=params.text,image=params.image||'',sticky=params.sticky||false,time_alive=params.time||'';this._verifyWrapper();this._item_count++;var number=this._item_count,tmp=this._tpl_item;this['_before_open_'+number]=($.isFunction(params.before_open))?params.before_open:function(){};this['_after_open_'+number]=($.isFunction(params.after_open))?params.after_open:function(){};this['_before_close_'+number]=($.isFunction(params.before_close))?params.before_close:function(){};this['_after_close_'+number]=($.isFunction(params.after_close))?params.after_close:function(){};this._custom_timer=0;if(time_alive){this._custom_timer=time_alive;}
var image_str=(image!='')?'<img src="'+image+'" class="gritter-image" />':'',class_name=(image!='')?'gritter-with-image':'gritter-without-image';tmp=this._str_replace(['[[username]]','[[text]]','[[image]]','[[number]]','[[class_name]]'],[user,text,image_str,this._item_count,class_name],tmp);this['_before_open_'+number]();$('#gritter-notice-wrapper').append(tmp);var item=$('#gritter-item-'+this._item_count);item.fadeIn(this.fade_in_speed,function(){Gritter['_after_open_'+number]($(this));});if(!sticky){this._setFadeTimer(item,number);}
$(item).bind('mouseenter mouseleave',function(event){if(event.type=='mouseenter'){if(!sticky){Gritter.restoreItemIfFading(this,number);}}
else{if(!sticky){Gritter._setFadeTimer(this,number);}}
Gritter._hoverState(this,event.type);});return number;},_countRemoveWrapper:function(unique_id){this['_after_close_'+unique_id]($('#gritter-item-'+unique_id));if($('.gritter-item-wrapper').length==0){$('#gritter-notice-wrapper').remove();}},_fade:function(e,unique_id){Gritter['_before_close_'+unique_id]($(e));$(e).animate({opacity:0},Gritter.fade_out_speed,function(){$(e).animate({height:0},300,function(){$(e).remove();Gritter._countRemoveWrapper(unique_id);})})},_hoverState:function(e,type){if(type=='mouseenter'){$(e).addClass('hover');if($(e).find('img').length){$(e).find('img').before(this._tpl_close);}
else{$(e).find('span').before(this._tpl_close);}
$(e).find('.gritter-close').click(function(){Gritter._remove(this);});}
else{$(e).removeClass('hover');$(e).find('.gritter-close').remove();}},_remove:function(e){var gritter_wrap=$(e).parents('.gritter-item-wrapper');var unique_id=gritter_wrap.attr('id').split('-')[2];this['_before_close_'+unique_id](gritter_wrap);gritter_wrap.fadeOut('medium',function(){$(this).remove();Gritter._countRemoveWrapper(unique_id);});},removeSpecific:function(unique_id,params){var e=$('#gritter-item-'+unique_id);this['_before_close_'+unique_id](e);if(typeof(params)==='object'){if(params.fade){var speed=this.fade_out_speed;if(params.speed){speed=params.speed;}
e.fadeOut(speed,function(){e.remove();});}}
else{e.remove();}
this._countRemoveWrapper(unique_id);},restoreItemIfFading:function(e,number){window.clearTimeout(Gritter['_int_id_'+number]);$(e).stop().css({opacity:1});},_runSetup:function(){for(opt in $.gritter.options){this[opt]=$.gritter.options[opt];}
this._is_setup=1;},_setFadeTimer:function(item,number){var timer_str=(this._custom_timer)?this._custom_timer:this.time;Gritter['_int_id_'+number]=window.setTimeout(function(){Gritter._fade(item,number);},timer_str);},stop:function(params){var before_close=($.isFunction(params.before_close))?params.before_close:function(){};var after_close=($.isFunction(params.after_close))?params.after_close:function(){};var wrap=$('#gritter-notice-wrapper');before_close(wrap);wrap.fadeOut(function(){$(this).remove();after_close();});},_str_replace:function(search,replace,subject,count){var i=0,j=0,temp='',repl='',sl=0,fl=0,f=[].concat(search),r=[].concat(replace),s=subject,ra=r instanceof Array,sa=s instanceof Array;s=[].concat(s);if(count){this.window[count]=0;}
for(i=0,sl=s.length;i<sl;i++){if(s[i]===''){continue;}
for(j=0,fl=f.length;j<fl;j++){temp=s[i]+'';repl=ra?(r[j]!==undefined?r[j]:''):r[0];s[i]=(temp).split(f[j]).join(repl);if(count&&s[i]!==temp){this.window[count]+=(temp.length-s[i].length)/f[j].length;}}}
return sa?s:s[0];},_verifyWrapper:function(){if($('#gritter-notice-wrapper').length==0){$('body').append(this._tpl_wrap);}}}})(jQuery);

View File

@ -0,0 +1,48 @@
/*
* stickyfloat - jQuery plugin for verticaly floating anything in a constrained area
*
* Example: jQuery('#menu').stickyfloat({duration: 400});
* parameters:
* duration - the duration of the animation
* startOffset - the amount of scroll offset after it the animations kicks in
* offsetY - the offset from the top when the object is animated
* lockBottom - 'true' by default, set to false if you don't want your floating box to stop at parent's bottom
* $Version: 05.16.2009 r1
* Copyright (c) 2009 Yair Even-Or
* vsync.design@gmail.com
*/
$.fn.stickyfloat = function(options, lockBottom) {
var $obj = this;
var parentPaddingTop = parseInt($obj.parent().css('padding-top'));
var startOffset = $obj.parent().offset().top;
var opts = $.extend({ startOffset: startOffset, offsetY: parentPaddingTop, duration: 200, lockBottom:true }, options);
$obj.css({ position: 'absolute' });
if(opts.lockBottom){
var bottomPos = $obj.parent().height() - $obj.height() + parentPaddingTop; //get the maximum scrollTop value
if( bottomPos < 0 )
bottomPos = 0;
}
$(window).scroll(function () {
$obj.stop(); // stop all calculations on scroll event
var pastStartOffset = $(document).scrollTop() > opts.startOffset; // check if the window was scrolled down more than the start offset declared.
var objFartherThanTopPos = $obj.offset().top > startOffset; // check if the object is at it's top position (starting point)
var objBiggerThanWindow = $obj.outerHeight() < $(window).height(); // if the window size is smaller than the Obj size, then do not animate.
// if window scrolled down more than startOffset OR obj position is greater than
// the top position possible (+ offsetY) AND window size must be bigger than Obj size
if( (pastStartOffset || objFartherThanTopPos) && objBiggerThanWindow ){
var newpos = ($(document).scrollTop() -startOffset + opts.offsetY );
if ( newpos > bottomPos )
newpos = bottomPos;
if ( $(document).scrollTop() < opts.startOffset ) // if window scrolled < starting offset, then reset Obj position (opts.offsetY);
newpos = parentPaddingTop;
$obj.animate({ top: newpos }, opts.duration );
}
});
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

View File

@ -0,0 +1,56 @@
/*
* jsTree default theme 1.0
* Supported features: dots/no-dots, icons/no-icons, focused, loading
* Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
*/
.jstree-default li,
.jstree-default ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
.jstree-default li { background-position:-90px 0; background-repeat:repeat-y; }
.jstree-default li.jstree-last { background:transparent; }
.jstree-default .jstree-open > ins { background-position:-72px 0; }
.jstree-default .jstree-closed > ins { background-position:-54px 0; }
.jstree-default .jstree-leaf > ins { background-position:-36px 0; }
.jstree-default .jstree-hovered { background:#FFF0C0; border:1px solid #841212; padding:0 2px 0 1px; color: #841212;}
.jstree-default .jstree-clicked { background:#FCFCFC; border:1px solid #FCFCFC; padding:0 2px 0 1px; color: #841212;}
.jstree-default a .jstree-icon { background-position:-56px -19px; }
.jstree-default a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
.jstree-default.jstree-focused { background:#FCFCFC; }
.jstree-default .jstree-no-dots li,
.jstree-default .jstree-no-dots .jstree-leaf > ins { background:transparent; }
.jstree-default .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
.jstree-default .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
.jstree-default .jstree-no-icons a .jstree-icon { display:none; }
.jstree-default .jstree-search { font-style:italic; }
.jstree-default .jstree-no-icons .checkbox { display:inline-block; }
.jstree-default .jstree-no-checkboxes .checkbox { display:none !important; }
.jstree-default .jstree-checked > a > .checkbox { background-position:-38px -19px; }
.jstree-default .jstree-unchecked > a > .checkbox { background-position:-2px -19px; }
.jstree-default .jstree-undetermined > a > .checkbox { background-position:-20px -19px; }
.jstree-default .jstree-checked > a > .checkbox:hover { background-position:-38px -37px; }
.jstree-default .jstree-unchecked > a > .checkbox:hover { background-position:-2px -37px; }
.jstree-default .jstree-undetermined > a > .checkbox:hover { background-position:-20px -37px; }
#vakata-dragged.jstree-default ins { background:transparent !important; }
#vakata-dragged.jstree-default .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
#vakata-dragged.jstree-default .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
#jstree-marker.jstree-default { background:url("d.png") -41px -57px no-repeat !important; }
.jstree-default a.jstree-search { color:aqua; }
#vakata-contextmenu.jstree-default-context,
#vakata-contextmenu.jstree-default-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
#vakata-contextmenu.jstree-default-context li { }
#vakata-contextmenu.jstree-default-context a { color:black; }
#vakata-contextmenu.jstree-default-context a:hover,
#vakata-contextmenu.jstree-default-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
#vakata-contextmenu.jstree-default-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
#vakata-contextmenu.jstree-default-context li ul { margin-left:-4px; }
/* TODO: IE6 support - the `>` selectors */

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,2 @@
order allow,deny
deny from all

View File

@ -0,0 +1,2 @@
order allow,deny
deny from all

View File

@ -2,11 +2,13 @@
<?php echo Form::open(); ?>
<table class="login">
<tr><td><b>User Name:</b></td></tr>
<tr><td><?php echo Form::input('admin_name',null,array('id'=>'login-uid','size'=>40));?></td></tr>
<tr><td><?php echo Form::input('username',null,array('id'=>'login-uid','size'=>40));?></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td><b>Password:</b></td></tr>
<tr><td><?php echo Form::password('password',null,array('id'=>'login-pwd','size'=>40));?></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<!-- @todo Password reset ability should be a config option (or auto detected) -->
<!-- <tr><td colspan="2"><?echo HTML::anchor('login/reset',_('Forgot your password?')); ?></td></tr> -->
<tr><td colspan="2" style="text-align: center;"><?php echo Form::submit('submit',_('Authenticate'));?></td></tr>
</table>
<?php echo Form::close(); ?>

View File

@ -0,0 +1 @@
<!-- This template is shown via CLI tasks -->