Changeset 11201
- Timestamp:
- 08/14/08 15:01:58 (5 months ago)
- Location:
- branches/remote-services/ebox/src
- Files:
-
- 1 added
- 3 modified
-
EBox/Auth.pm (modified) (4 diffs)
-
EBox/CGI/Login/Index.pm (modified) (1 diff)
-
libexec/Makefile.am (modified) (1 diff)
-
libexec/ebox-start-script-session (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/remote-services/ebox/src/EBox/Auth.pm
r10308 r11201 36 36 # By now, the expiration time for session is hardcoded here 37 37 use constant EXPIRE => 3600; #In seconds 1h 38 # By now, the expiration time for a SOAPsession39 use constant MAX_S OAP_SESSION => 10; # In seconds38 # By now, the expiration time for a script session 39 use constant MAX_SCRIPT_SESSION => 10; # In seconds 40 40 41 41 sub new … … 160 160 my ($self, $r, $passwd) = @_; 161 161 162 # If there's a SOAPsession opened, give it priority to the162 # If there's a script session opened, give it priority to the 163 163 # Web interface session 164 if ( $self->_acti veSOAPSession() ){165 EBox::warn('Failed login since a SOAPsession is opened');166 $r->subprocess_env(LoginReason => 'S OAPactive');164 if ( $self->_actionScriptSession() ){ 165 EBox::warn('Failed login since a script session is opened'); 166 $r->subprocess_env(LoginReason => 'Script active'); 167 167 return; 168 168 } … … 199 199 my $expired = _timeExpired($lastime); 200 200 201 if ( $self->_acti veSOAPSession() ) {202 $r->subprocess_env(LoginReason => 'S OAPactive');201 if ( $self->_actionScriptSession() ) { 202 $r->subprocess_env(LoginReason => 'Script active'); 203 203 _savesession(undef); 204 204 } … … 296 296 } 297 297 298 # Method: _acti veSOAPSession299 # 300 # Check whether a SOAPsession is already opened or not298 # Method: _actionScriptSession 299 # 300 # Check whether a script session is already opened or not 301 301 # 302 302 # Returns: 303 303 # 304 # Boolean - indicate if a SOAPsession is already opened305 # 306 sub _acti veSOAPSession304 # Boolean - indicate if a script session is already opened 305 # 306 sub _actionScriptSession 307 307 { 308 308 309 309 my ($self) = @_; 310 310 311 # The SOAPsession filehandle312 my $s oapSessionFile;313 314 unless ( -e EBox::Config->s oapSession() ){311 # The script session filehandle 312 my $scriptSessionFile; 313 314 unless ( -e EBox::Config->scriptSession() ){ 315 315 return undef; 316 316 } 317 317 318 # Trying to open the s oapsid319 open( $s oapSessionFile, '<', EBox::Config->soapSession() ) or318 # Trying to open the script sid 319 open( $scriptSessionFile, '<', EBox::Config->scriptSession() ) or 320 320 throw EBox::Exceptions::Internal('Could not open ' . 321 EBox::Config->s oapSession());321 EBox::Config->scriptSession()); 322 322 323 323 # Lock in shared mode 324 flock($s oapSessionFile, LOCK_SH)324 flock($scriptSessionFile, LOCK_SH) 325 325 or throw EBox::Exceptions::Lock($self); 326 326 327 327 # The file structure is the following: 328 328 # TIMESTAMP 329 my ($timeStamp) = <$s oapSessionFile>;329 my ($timeStamp) = <$scriptSessionFile>; 330 330 331 331 # Release the lock and close the file 332 flock($s oapSessionFile, LOCK_UN);333 close($s oapSessionFile);332 flock($scriptSessionFile, LOCK_UN); 333 close($scriptSessionFile); 334 334 335 335 # time() return the # of seconds since an epoch (1 Jan 1970 336 336 # typically) 337 337 338 my $expireTime = $timeStamp + MAX_S OAP_SESSION;338 my $expireTime = $timeStamp + MAX_SCRIPT_SESSION; 339 339 return ( $expireTime >= time() ); 340 340 -
branches/remote-services/ebox/src/EBox/CGI/Login/Index.pm
r10308 r11201 58 58 59 59 my $reason; 60 if ( (defined ($envre) ) and ($envre eq 'S OAPactive') ) {61 $reason = __('There is a Web service script running. ' .60 if ( (defined ($envre) ) and ($envre eq 'Script active') ) { 61 $reason = __('There is a script which has asked to run in eBox exclusively. ' . 62 62 'Please, wait patiently until it is done'); 63 63 } -
branches/remote-services/ebox/src/libexec/Makefile.am
r10308 r11201 3 3 scriptsdir = @DATADIR@/ebox 4 4 5 scripts_SCRIPTS = ebox-loggerd ebox-kill-pid 5 scripts_SCRIPTS = ebox-loggerd ebox-kill-pid ebox-start-script-session 6 6 7 7 MAINTAINERCLEANFILES = Makefile.in
