<?php
//Error code
define("SECUOTP_ERROR_SUCCESS", 0);						//operation succeed
define("SECUOTP_ERROR_CONNECTDBFAILED", 15);	//connect database failed
define("SECUOTP_ERROR_SQLEXFAILED", 16);			//sql statement execute failed
define("SECUOTP_ERROR_NORELATEITEM", 17);			//no related items in database
define("SECUOTP_ERROR_GETUSERINFO_FAILED", 18);//get user info failed
define("SECUOTP_ERROR_USERREGLOST", 19);			//user register lost
define("SECUOTP_ERROR_USERLOCKED", 20);				//user is locked
define("SECUOTP_ERROR_UNLOCK_FAILED", 21);		//set user unlock
define("SECUOTP_ERROR_UPDATEUSEDATE_FAILED", 22);	//update operation time failed
define("SECUOTP_ERROR_UNKNOWNTKTYPE", 23);			//unknown token type
define("SECUOTP_ERROR_UPCHALLENGE_FAILED", 24);	//update challenge number failed
define("SECUOTP_ERROR_INVALID_PASSWORD", 25);		//authentication password error
define("SECUOTP_ERROR_SYNCHRONIZE_FAILED", 26);	//synchronize token failed
define("SECUOTP_ERROR_INVALID_OLDPWD", 27);			//invalid old password
define("SECUOTP_ERROR_INVALID_AUTHTYPE", 28);		//invalid authentication type
define("SECUOTP_ERROR_USEREXIST", 29);					//user already exist
define("SECUOTP_ERROR_INVALID_TOKEN", 30);			//invalid token
define("SECUOTP_ERROR_INVALID_PARAM", 31);			//invalid param
define("SECUOTP_ERROR_ADDUSER_FAILED", 32);			//add user failed
define("SECUOTP_ERROR_UPDATETOKEN_FAILED", 33);	//update token status failed
define("SECUOTP_ERROR_DELETETOKEN_FAILED", 34);	//delete token failed
define("SECUOTP_ERROR_GETTOKENSTATE_FAILED", 35);//get token status failed
define("SECUOTP_ERROR_TOKENINUSE", 36);					//token is in using status
define("SECUOTP_ERROR_INVALIDKEY", 37);					//credential error
define("SECUOTP_ERROR_OPENTOKENFILE_FAILED", 38);//open token file failed
define("SECUOTP_ERROR_AESMKKEY_FAILED", 39);		//make key failed
define("SECUOTP_ERROR_AESDECRYPT_FAILED", 40);	//decrypt failed
define("SECUOTP_ERROR_AESGETPLAIN_FAILED", 41);	//get plain failed
define("SECUOTP_ERROR_AUTHSUCCESS_WITHINFO", 42); //authentication succeed with information
define("SECUOTP_ERROR_UPDATEKEYINFO_FAILED", 43); //update counter failed
define("SECUOTP_ERROR_NOTNEEDSYNCHRONIZE", 44);		//challenge -response need not synchronize
define("SECUOTP_ERROR_SETUSERPIN_FAILED", 45);		//set pin for user failed
define("SECUOTP_ERROR_UPDATEPIN_FAILED", 46);			//
define("SECUOTP_ERROR_UPDATEAUTHTYPE_FAILED", 47);//update authentication type failed
define("SECUOTP_ERROR_DELETEUSER_FAILED", 48);		//delete user failed
define("SECUOTP_ERROR_UPLOCKSTATUS_FAILED", 49);	//update user lock status failed
define("SECUOTP_ERROR_SUCCESS_WITHINFO", 50);			//operation succeed with information
define("SECUOTP_ERROR_UPDATEUSERBINDINFO_FAILED", 51); //update user bind information failed
define("SECUOTP_ERROR_INVALIDLOGLEV", 52);			//invlaid log level


define("SECUOTP_ERROR_FILENOTEXIST", 55);					//file not exist

define("SECUOTP_ERROR_CHALLENGE", 100);					//response needs for the server challenge

define("SECU100", 1);//event based
define("SECU200", 2);//time based
define("SECU300", 3);//challenge-response based

//operation type
define("AUTH", 1);						//user authentication
define("ADD_USER", 11);				//add user
define("DELETE_USER", 12);		//delete user
define("TOKEN_SYNCHRONIZE", 13);//synchronize token
define("SET_USER_PIN", 15);			//set user pin
define("SET_USER_AUTHTYPE", 16);//set user authentication type
define("SET_USER_INVALID", 17);//register lost
define("SET_USER_LOCK", 18);		//switch user's lock status
define("USER_IMPORT", 23);			//import users
define("TOKEN_IMPORT", 25);			//import tokens
define("TOKEN_DELETE", 26);			//delete token

define("SECUOTP_PRI_SUPER", 1); //super administrator
define("SECUOTP_PRI_ADMIN", 4); //administrator
define("SECUOTP_PRI_OPERATOR", 10);//common operator
define("SECUOTP_PRI_USER", 100);//user
?>