public function webservice_authentication($email, $password) { $obj_fnlResult = new returnResult(); $obj_userResult = BL_manageUser::authenticateUser($email, $password); $sessionkey = ""; $isValid = 0; $msg = ""; if ($obj_userResult->type == 0) { $obj_fnlResult->type = 0; $obj_fnlResult->msg = $obj_userResult->msg; } else { $obj_user = $obj_userResult->data; if ($obj_user->userStatus == 1) { $isValid = 1; $errorMsg = $obj_userResult->msg; $sess_result = BL_manageWebService::validateSessionByUserId($obj_user->userId); $obj_fnlResult->type = 1; if ($sess_result->type == 1) { $isValid = 1; $sessionkey = $sess_result->data->sessionKey; $msg = "Successfuly joined to session which already created"; $obj_fnlResult->data = array('validstatus' => $isValid, 'sessionkey' => $sessionkey, 'message' => $msg); } else { $obj_newsessResult = DAL_manageWebService::addNewSessionKey($obj_user->email, $obj_user->userId, BL_manageWebService::generateSessionKey()); if ($obj_newsessResult->type == 1) { $isValid = 1; $sessionkey = $obj_newsessResult->data; $msg = "New session successfuly created"; $obj_fnlResult->data = array('validstatus' => $isValid, 'sessionkey' => $sessionkey, 'message' => $msg); } else { $isValid = 0; $msg = "Problem occured while creating new session"; $obj_fnlResult->data = array('validstatus' => $isValid, 'sessionkey' => $sessionkey, 'message' => $msg); } } } else { if ($obj_user->userStatus == 0) { $isValid = 0; $errorMsg = "Sorry, your account is not verified yet."; $obj_fnlResult->type = 1; } } } return $obj_fnlResult; }
function loadUser($_GET) { global $LANG; //$userId = isset($_GET["userId"]) ? $_GET["userId"] : (isset($_SESSION["userId"])?$_SESSION["userId"] :1) ; //$_SESSION["userId"] = $userId; ?> <div class="common_button2"> <ul> <?php //if(common::checkPermission(USERMANAGE_ADDUSER_ACTIONID_VIEW,$userId)) // { echo "<li class=\"btnleft\"><a href=\"?page=Dashboard\" id=\"btnback\"><div class=\"doublearrow\">«</div> BACK</a></li>"; echo "<li class=\"btnright\"><a id=\"btnaddUser\" href=\"#\"><div class=\"doublearrow\">+</div>ADD User</a></li>"; // } ?> </ul> </div> <div class="common_body_content clearfix" > <div class="main_content_outer"> <div class="main_content"> <div class="content_header"> <div class="title_user">Manage User</div> <div class="title_searchbox"><input id="searchtextbox" class="searchtextbox" type="text" value="Search here..."></div> </div> <table cellpadding="0" cellspacing="0" style="width:100%"><tr><td> <div class="main_listview"> <ul id="UserList" class="main_listviewul"> <?php $result = BL_manageUser::getUserList(); if ($result->type == 1) { $arr_UserList = $result->data; if (count($arr_UserList) > 0) { foreach ($arr_UserList as $obj_User) { $html = "<li class=\"ListRow\" id=\"UserListRow_" . $obj_User->userId . "\">"; $html .= "<div class=\"datarow\">" . $obj_User->userId . "</div>"; $html .= "<div class=\"datarow\">" . $obj_User->userName . "</div>"; $html .= "<div class=\"datarow\">" . $obj_User->password . "</div>"; $html .= "<div class=\"datarow\">" . $obj_User->personId . "</div>"; $html .= "<div class=\"datarow\">" . $obj_User->userType . "</div>"; $html .= "<div class=\"databtncell\"><a href=\"#\" class=\"rowbtn\">Edit</a></div>"; $html .= "<div class=\"databtncell\"><a href=\"#\" class=\"rowbtn\">Delete</a></div>"; $html .= "<input id=\"User_" . $obj_User->userId . "\" type = \"hidden\" value=\"" . $obj_User->getUserData() . "\"></li>"; echo $html; } } echo "<div id=\"contentError\" class=\"contenterror_hidden\">No User found... </div>"; } else { echo "<div id=\"contentError\" class=\"contenterror\">No User found... </div>"; } ?> </ul> <div id="popUserform" class="formPopup"> <div class="subheader"><?php echo $LANG['SUBHEADER_USER']; ?> </div> <div class="formerror" id="formerror"></div> <input type="hidden" id="FormMode" name="FormMode" value="add" > <ul class="Userform"> <li><div class="label"><?php echo $LANG['USERID']; ?> </div><div class="fromfield"><input type="text" id="Input_userId" name="Input_userId" value="" class="form_area_textbox"></div></li> <li><div class="label"><?php echo $LANG['USERNAME']; ?> </div><div class="fromfield"><input type="text" id="Input_userName" name="Input_userName" value="" class="form_area_textbox"></div></li> <li><div class="label"><?php echo $LANG['PASSWORD']; ?> </div><div class="fromfield"><input type="text" id="Input_password" name="Input_password" value="" class="form_area_textbox"></div></li> <li><div class="label"><?php echo $LANG['PERSONID']; ?> </div><div class="fromfield"><input type="text" id="Input_personId" name="Input_personId" value="" class="form_area_textbox"></div></li> <li><div class="label"><?php echo $LANG['USERTYPE']; ?> </div><div class="fromfield"><input type="text" id="Input_userType" name="Input_userType" value="" class="form_area_textbox"></div></li> <li><div class="label"></div><div class="fromfield"><br/><br/><input id="form_addbtn" class="common_button" type="button" ></div></li> </ul> </div> </div> </td></tr></table> <div class="main_content_footer"></div> </div> </div> </div> <?php }
function getUserByuserId($sessionkey, $appcode, $id) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result .= "<AUTHSTATUS>1</AUTHSTATUS>"; $result = BL_manageUser::getUserListByuserId($id); if ($result->type == 1) { $arr_UserList = $result->data; if (count($arr_UserList) > 0) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; foreach ($arr_UserList as $obj_User) { $main_result .= getUserXml($obj_User); } } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
function login($_POST, $_GET) { $Username; $Password; $errorCode = 0; if (isset($_POST['login'])) { if (isset($_POST["Username"]) && !is_null($_POST["Username"])) { $Username = $_POST["Username"]; } else { $errorCode = 1; $errormsg = "<span class=\"error\">please enter Username<span><br/>"; } if (isset($_POST["Password"]) && !is_null($_POST["Password"])) { $Password = $_POST["Password"]; } else { $errorCode = 2; $errormsg .= "<span class=\"error\">Please enter Password<span><br/>"; } if ($errorCode > 0) { $_SESSION["loginerror"] = $errormsg; } else { $obj_result = BL_manageUser::authenticateUser($Username, $Password); if ($obj_result->type == 0) { $_SESSION["login"] = 0; $_SESSION["loginerror"] = $obj_result->msg; } else { $obj_User = $obj_result->data; print_r($obj_User); if ($obj_User->userStatus == 1) { $_SESSION["login"] = 1; $_SESSION["user"] = serialize($obj_User); } else { if ($obj_User->userStatus == 0) { $_SESSION["login"] = 0; $_SESSION["loginerror"] = "Sorry, your account is not verified yet."; } } } } } else { $errorCode = 0; $optCode; $userId; if (isset($_GET["optcode"]) && !is_null($_GET["optcode"])) { $optCode = $_GET["optcode"]; } else { $errorCode = 1; // $errormsg = "<span class=\"error\">Error in opt-code<span><br/>"; } if (isset($_GET["userid"]) && !is_null($_GET["userid"])) { $userId = $_GET["userid"]; } else { $errorCode = 2; // $errormsg = "<span class=\"error\">Error in email verification<span><br/>"; } if ($errorCode > 0) { if ($errorCode != 1) { $_SESSION["loginerror"] = $errormsg; } } else { $obj_result = BL_manageUser::authOptCode($userId, $optCode); if ($obj_result->type == 1) { $obj_user = $obj_result->data; if ($obj_user->userStatus == 0) { $_SESSION["login"] = 1; $_SESSION["user"] = serialize($obj_user); } else { $_SESSION["login"] = 0; $_SESSION["loginerror"] = "Your account is already verified"; } } else { $_SESSION["login"] = 0; $_SESSION["loginerror"] = $obj_result->msg; } } } }
public static function deleteUser($obj_mainpacket) { $packet = $obj_mainpacket->packet; $userId = $packet[0]; $msg = "failed"; $result = 0; $result_userId = 0; $retResult = BL_manageUser::getUserListByuserId($userId); if ($retResult->type == 1) { $obj_User = $retResult->data[0]; $obj_result2 = DAL_manageUser::deleteUser($obj_User->userId); if ($obj_result2->type == 1) { $result = 1; $result_userId = $obj_User->userId; $msg = "success"; } else { $msg = "Sorry!!! Problem occured while deleting this User"; } } else { $msg = "Sorry!!! The User you are tring to delete is not found"; } $obj_mainpacket->returnValues = array($result, $obj_User->userId, $msg); $obj_mainpacket->main_setPacket(); }
function handleRequest($packagePacketText) { $obj_packagepacket = new packagepacket(); $obj_packagepacket->set_InPackagePacket($packagePacketText); $obj_me = unserialize($_SESSION["user"]); foreach ($obj_packagepacket->mainpacketList as $obj_mainpacket) { switch ($obj_mainpacket->moduleId) { case 1: onIncommingMessage($obj_mainpacket); break; case 2: BL_manageAgriculture::onIncommingMessage($obj_mainpacket); break; case 3: BL_manageAlsubjects::onIncommingMessage($obj_mainpacket); break; case 4: BL_manageBusiness::onIncommingMessage($obj_mainpacket); break; case 5: BL_manageBusiness_product::onIncommingMessage($obj_mainpacket); break; case 6: BL_manageBusinesstype::onIncommingMessage($obj_mainpacket); break; case 7: BL_manageForesttype::onIncommingMessage($obj_mainpacket); break; case 8: BL_manageGeographytype::onIncommingMessage($obj_mainpacket); break; case 9: BL_manageGroup::onIncommingMessage($obj_mainpacket); break; case 10: BL_manageGroup_member::onIncommingMessage($obj_mainpacket); break; case 11: BL_manageGroupmissiontype::onIncommingMessage($obj_mainpacket); break; case 12: BL_manageHigherstudysubjects::onIncommingMessage($obj_mainpacket); break; case 13: BL_manageIndustrial::onIncommingMessage($obj_mainpacket); break; case 14: BL_manageLocation::onIncommingMessage($obj_mainpacket); break; case 15: BL_manageLocation_resources::onIncommingMessage($obj_mainpacket); break; case 16: BL_manageOlsubjects::onIncommingMessage($obj_mainpacket); break; case 17: BL_manageOrganization::onIncommingMessage($obj_mainpacket); break; case 18: BL_manageOrganization_subtype::onIncommingMessage($obj_mainpacket); break; case 19: BL_manageOrganizationtype::onIncommingMessage($obj_mainpacket); break; case 20: BL_managePerson::onIncommingMessage($obj_mainpacket); break; case 21: BL_managePerson_address::onIncommingMessage($obj_mainpacket); break; case 22: BL_managePerson_alresult::onIncommingMessage($obj_mainpacket); break; case 23: BL_managePerson_educationlevel::onIncommingMessage($obj_mainpacket); break; case 24: BL_managePerson_highereducation::onIncommingMessage($obj_mainpacket); break; case 25: BL_managePerson_languageskill::onIncommingMessage($obj_mainpacket); break; case 26: BL_managePerson_olresult::onIncommingMessage($obj_mainpacket); break; case 27: BL_managePerson_property::onIncommingMessage($obj_mainpacket); break; case 28: BL_managePerson_talent::onIncommingMessage($obj_mainpacket); break; case 29: BL_managePerson_telephone::onIncommingMessage($obj_mainpacket); break; case 30: BL_managePerson_vocationaltraining::onIncommingMessage($obj_mainpacket); break; case 31: BL_managePerson_workingexperiance::onIncommingMessage($obj_mainpacket); break; case 32: BL_managePlants::onIncommingMessage($obj_mainpacket); break; case 33: BL_managePrimarygeolayertype::onIncommingMessage($obj_mainpacket); break; case 34: BL_manageProduct::onIncommingMessage($obj_mainpacket); break; case 35: BL_manageService::onIncommingMessage($obj_mainpacket); break; case 36: BL_manageSocierytype::onIncommingMessage($obj_mainpacket); break; case 37: BL_manageSociety::onIncommingMessage($obj_mainpacket); break; case 38: BL_manageSociety_member::onIncommingMessage($obj_mainpacket); break; case 39: BL_manageSoiltype::onIncommingMessage($obj_mainpacket); break; case 40: BL_manageTalent::onIncommingMessage($obj_mainpacket); break; case 41: BL_manageTown::onIncommingMessage($obj_mainpacket); break; case 42: BL_manageTrading::onIncommingMessage($obj_mainpacket); break; case 43: BL_manageTraditionalknowledgecategory::onIncommingMessage($obj_mainpacket); break; case 44: BL_manageTransport::onIncommingMessage($obj_mainpacket); break; case 45: BL_manageUser::onIncommingMessage($obj_mainpacket); break; case 46: BL_manageVillage::onIncommingMessage($obj_mainpacket); break; case 47: BL_manageVillage_agriculture::onIncommingMessage($obj_mainpacket); break; case 48: BL_manageVillage_climate::onIncommingMessage($obj_mainpacket); break; case 49: BL_manageVillage_enterance::onIncommingMessage($obj_mainpacket); break; case 50: BL_manageVillage_geologicalvariation::onIncommingMessage($obj_mainpacket); break; case 51: BL_manageVillage_group::onIncommingMessage($obj_mainpacket); break; case 52: BL_manageVillage_history::onIncommingMessage($obj_mainpacket); break; case 53: BL_manageVillage_image::onIncommingMessage($obj_mainpacket); break; case 54: BL_manageVillage_industrial::onIncommingMessage($obj_mainpacket); break; case 55: BL_manageVillage_neartowns::onIncommingMessage($obj_mainpacket); break; case 56: BL_manageVillage_organization::onIncommingMessage($obj_mainpacket); break; case 57: BL_manageVillage_othernames::onIncommingMessage($obj_mainpacket); break; case 58: BL_manageVillage_plant::onIncommingMessage($obj_mainpacket); break; case 59: BL_manageVillage_service::onIncommingMessage($obj_mainpacket); break; case 60: BL_manageVillage_society::onIncommingMessage($obj_mainpacket); break; case 61: BL_manageVillage_trading::onIncommingMessage($obj_mainpacket); break; case 62: BL_manageVillage_traditionalknowledge::onIncommingMessage($obj_mainpacket); break; case 63: BL_manageVillage_transport::onIncommingMessage($obj_mainpacket); break; case 64: BL_manageLanguage::onIncommingMessage($obj_mainpacket); break; } } echo $obj_packagepacket->get_OutPackagePacket(); }