public class Login extends Module
Modifier and Type | Field and Description |
---|---|
static int |
RELOGIN_TIME
Time to force relogin
|
static String |
TAG
Login tag name for Logcat
|
isConnected, result
dbHelper, isDebuggable
Constructor and Description |
---|
Login() |
Modifier and Type | Method and Description |
---|---|
protected void |
connect()
Launches action in a separate thread while shows a progress dialog
in UI thread.
|
static int |
getCurrentUserRole()
Gets the role of the logged user in the current selected course
|
static long |
getLastLoginTime()
Gets start time of application
|
static User |
getLoggedUser()
Gets the user logged on SWAD
|
static boolean |
isLogged()
Checks if user is already logged on SWAD
|
protected void |
onCreate(Bundle savedInstanceState) |
protected void |
onError()
Error handler
|
protected void |
onStart() |
protected void |
postConnect()
Launches action after executing connect() method
|
protected void |
requestService()
Connects to SWAD and gets user data.
|
static void |
setCurrentUserRole(int userRole)
Sets user role in the current selected course
|
static void |
setLastLoginTime(long l)
Sets start time of application
|
static void |
setLogged(boolean logged)
Sets user logged flag
|
static void |
setLoggedUser(User loggedUser)
Sets the user logged on SWAD
|
addParam, createRequest, onActivityResult, onPause, onResume, runConnection, sendRequest, sendRequest, setMETHOD_NAME, startConnection
error, onCreateOptionsMenu, onOptionsItemSelected, showDialog
public static final int RELOGIN_TIME
public static final String TAG
protected void connect()
protected void requestService() throws Exception
requestService
in class Module
Exception
SoapFault
NoSuchAlgorithmException
IOException
XmlPullParserException
protected void postConnect()
Module
postConnect
in class Module
protected void onError()
Module
public static boolean isLogged()
public static void setLogged(boolean logged)
logged
- User logged flagpublic static User getLoggedUser()
public static void setLoggedUser(User loggedUser)
public static long getLastLoginTime()
public static void setLastLoginTime(long l)
l
- Start time of applicationpublic static void setCurrentUserRole(int userRole)
userRole
- Role of the user: 0- unknown STUDENT_TYPE_CODE - student TEACHER_TYPE_CODE - teacherpublic static int getCurrentUserRole()