Changeset 20567 for events

Show
Ignore:
Timestamp:
10/03/08 12:49:55 (2 months ago)
Author:
riaf
Message:

rhacoのバグとかいろいろで一旦作業中断><!

Location:
events/phpframework/rhaco/trunk
Files:
2 added
2 modified

Legend:

Unmodified
Added
Removed
  • events/phpframework/rhaco/trunk/library/model/LoginCondition.php

    • Property svn:keywords changed from Id Date Author to Id
    r20566 r20567  
    1515class LoginCondition extends RequestLoginCondition 
    1616{ 
    17     // TODO: コード書くw 
     17    var $dbUtil; 
     18     
     19    function LoginCondition(&$db){ 
     20        $this->dbUtil =& $db; 
     21    } 
     22 
     23    function condition($request){ 
     24        if($request->isPost()){ 
     25            if($request->getVariable('login') == ''){ 
     26                ExceptionTrigger::raise(new RequireException(array(Message::_('name'))), 'user_mail'); 
     27            } 
     28            if($request->getVariable('password') == ''){ 
     29                ExceptionTrigger::raise(new RequireException(array(Message::_('password'))), 'user_password'); 
     30            } 
     31            if(ExceptionTrigger::isException()){ 
     32                return false; 
     33            } 
     34             
     35            $login = $request->getVariable('login'); 
     36            if(strpos($login, '@') !== false){ 
     37                $criterion = Q::eq(User::columnEMail(), $login); 
     38            } else { 
     39                $criterion = Q::eq(User::columnName(), $login); 
     40            } 
     41            $account = $this->dbUtil->get( 
     42                new User(), 
     43                new C( 
     44                    $criterion, 
     45                    Q::eq(User::columnPassword(), sha1($request->getVariable('password'))) 
     46                ) 
     47            ); 
     48            if(Variable::istype('TableObjectBase', $account)){ 
     49                RequestLogin::setLoginSession($account); 
     50                return true; 
     51            } 
     52        } 
     53        return false; 
     54    } 
     55     
     56    function _invalidForward($request){ 
     57        $htmlParser = new HtmlParser(); 
     58        $login = $request->getVariable("login"); 
     59 
     60        $request->clearVariable("password","login","args"); 
     61        $htmlParser->setVariable("requestvar",$request->getVariable()); 
     62        $template = Rhaco::templatepath("login.html"); 
     63        $htmlParser->write($template); 
     64        Rhaco::end(); 
     65    } 
     66    // spell miss?? 
     67    function _invalidForword($request){ 
     68        return $this->_invalidForward($request); 
     69    } 
    1870} 
  • events/phpframework/rhaco/trunk/resources/templates/default/layout.html

    r15508 r20567  
    114114</div> 
    115115</body> 
    116 </html> 
     116</html>==== ORIGINAL VERSION rhaco/trunk/resources/templates/default/layout.html 122300518486172