Changeset 152

Show
Ignore:
Timestamp:
07/10/06 15:19:44 (7 years ago)
Author:
dez
Message:

Adds new mail check

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lib/session.php

    r139 r152  
    1818public  $username='';           // Username 
    1919public  $fullname;              // Fullname 
     20public  $email=0;               // Email waiting? 
    2021public  $groups  =array();      // users groups 
    2122public  $data='';               // Var/array for session persistant data 
     
    166167                ldap_close($ldap); 
    167168 
     169                // Check the user's email status 
     170                $mailstat = stat("/var/spool/mail/".$user); 
     171                if ($mailstat[size]>0) { 
     172                        if ($mailstat[mtime]>$mailstat[atime]) $this->email = 2; 
     173                        else $this->email = 1; 
     174                } 
     175 
    168176                $this->fullname = $info['cn'][0]; 
    169177                $this->groups = $info['grouplist']; 
     178 
    170179        } 
    171180 
  • templates/login.tpl

    r139 r152  
    44{if $session->loggedin} 
    55Logged in as {$session->username}<br/> 
     6{if $session->email=="0"} 
     7No email<br /> 
     8{elseif $session->email=="1"} 
     9Email waiting<br /> 
     10{elseif $session->email=="2"} 
     11New email<br /> 
     12{/if} 
    613                                        <input type="submit" class="button" name="Logout" id="Logout" value="Logout" /> 
    714{else}