Mercurial > hg > ltpda
comparison m-toolbox/classes/@LTPDARepositoryManager/cb_timerClearPassord.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % cb_timerClearPassord callback method which disconnects the connection and clears the password | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % description: cb_timerClearPassord callback method which disconnects the | |
5 % connection and clears the password | |
6 % | |
7 % version: $Id: cb_timerClearPassord.m,v 1.6 2010/08/16 18:04:36 ingo Exp $ | |
8 % | |
9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
10 | |
11 function varargout = cb_timerClearPassord(varargin) | |
12 | |
13 prefs = getappdata(0, 'LTPDApreferences'); | |
14 | |
15 rm = LTPDARepositoryManager(); | |
16 conns = rm.manager.getConnections(); | |
17 | |
18 if ~isempty(conns) | |
19 | |
20 for ii=1:conns.size | |
21 conn = conns.get(ii-1); | |
22 | |
23 % Clear the password only if the connection is not locked | |
24 if ~conn.isLocked | |
25 if conn.isConnected | |
26 conn.closeConnection(); | |
27 end | |
28 | |
29 if (conn.agePassword > double(prefs.getRepoPrefs.getExpiry)) | |
30 conn.setPassword(''); | |
31 end | |
32 end | |
33 | |
34 end | |
35 | |
36 end | |
37 if ~isempty(rm.gui) | |
38 rm.gui.reloadConnectionTable(); | |
39 end | |
40 end |