PHP code for automatic registration of login verification mechanism

WBOY
Release: 2016-07-25 09:05:24
Original
1464 people have browsed it
  1. $urls = parse_url($db_bbsurl);
  2. $domain = $urls['host'];
  3. include_once (R_P .'require/admvclient.php');
  4. $adm_oem= new Cnzz_Adm_Oem();
  5. //Determine whether the user password exists in the config file
  6. pwCache::getData(D_P . "data/bbscache/adm_config.php");//Username and password configuration file
  7. if (isset($adm_user) && isset ($adm_pwd)) {
  8. $request = array("adm_user"=>$adm_user,"adm_pwd"=>$adm_pwd,'cms'=>'pw');
  9. $token = $adm_oem-> get_appkey_once($request);
  10. if ($token<0){
  11. if($token==-1){
  12. adminmsg('The passed parameter is empty or the passed parameter is not a number');
  13. }else if($token= =-2){
  14. adminmsg('Error passing parameter password');
  15. }
  16. }else{
  17. $apikey = $token['adm_key'];
  18. }
  19. }else{
  20. $Key = md5($domain.' KclGiq7H');
  21. $request = array('cms'=>'pw','domain'=>$domain,'key'=>$Key);
  22. $token = $adm_oem->reg_user_once( $request);
  23. if ($token<0){//Exception
  24. if($token==-1){
  25. adminmsg('key is wrong');
  26. } else if($token==-2){
  27. adminmsg('The domain name length is incorrect (1~64)');
  28. } elseif($token==-3){
  29. adminmsg('The domain name input is incorrect (such as entering Chinese characters)');
  30. } elseif($token ==-4){
  31. adminmsg('The domain name is incorrectly inserted into the database');
  32. } elseif($token==-5){
  33. adminmsg('The page called by the IP user exceeds the threshold, and the threshold is tentatively set to 10') ;
  34. }
  35. } elseif (is_array($token) && isset($token)){
  36. $adm_user = $token['adm_user'];
  37. $adm_pwd = $token['adm_pwd'];
  38. $apikey = $token ['adm_key'];
  39. pwCache::setData(D_P.'data/bbscache/adm_config.php',"");
  40. }
  41. }
  42. ?>
Copy code


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template