MemberConnect.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../../class/connect.php");
  4. require("../../class/db_sql.php");
  5. require("../../class/functions.php");
  6. $link=db_connect();
  7. $empire=new mysqlquery();
  8. $editor=1;
  9. //验证用户
  10. $lur=is_login();
  11. $logininid=$lur['userid'];
  12. $loginin=$lur['username'];
  13. $loginrnd=$lur['rnd'];
  14. $loginlevel=$lur['groupid'];
  15. $loginadminstyleid=$lur['adminstyleid'];
  16. //ehash
  17. $ecms_hashur=hReturnEcmsHashStrAll();
  18. //验证权限
  19. CheckLevel($logininid,$loginin,$classid,"memberconnect");
  20. //设置接口
  21. function EditMemberConnect($add,$userid,$username){
  22. global $empire,$dbtbpre;
  23. $add[id]=(int)$add[id];
  24. if(empty($add[appname])||!$add[id])
  25. {
  26. printerror("EmptyMemberConnect","history.go(-1)");
  27. }
  28. $add[isclose]=(int)$add[isclose];
  29. $add[myorder]=(int)$add[myorder];
  30. $add[appname]=eaddslashes(ehtmlspecialchars($add[appname]));
  31. $add[appid]=eaddslashes($add[appid]);
  32. $add[appkey]=eaddslashes($add[appkey]);
  33. $add[qappname]=eaddslashes($add[qappname]);
  34. $add[appsay]=eaddslashes($add[appsay]);
  35. $sql=$empire->query("update {$dbtbpre}enewsmember_connect_app set appname='$add[appname]',appid='$add[appid]',appkey='$add[appkey]',isclose='$add[isclose]',myorder='$add[myorder]',qappname='$add[qappname]',appsay='$add[appsay]' where id='$add[id]'");
  36. $appr=$empire->fetch1("select apptype from {$dbtbpre}enewsmember_connect_app where id='$add[id]'");
  37. if($sql)
  38. {
  39. GetConfig();
  40. //操作日志
  41. insert_dolog("id=".$add[id]."&apptype=".$appr[apptype]."<br>appname=".$add[appname]);
  42. printerror("EditMemberConnectSuccess","MemberConnect.php".hReturnEcmsHashStrHref2(1));
  43. }
  44. else
  45. {
  46. printerror("DbError","history.go(-1)");
  47. }
  48. }
  49. $enews=$_POST['enews'];
  50. if(empty($enews))
  51. {$enews=$_GET['enews'];}
  52. if($enews)
  53. {
  54. hCheckEcmsRHash();
  55. }
  56. //增加用户
  57. if($enews=="EditMemberConnect")
  58. {
  59. EditMemberConnect($_POST,$logininid,$loginin);
  60. }
  61. $sql=$empire->query("select * from {$dbtbpre}enewsmember_connect_app order by myorder,id");
  62. ?>
  63. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  64. <html>
  65. <head>
  66. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  67. <title>外部登录接口</title>
  68. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  69. </head>
  70. <body>
  71. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  72. <tr>
  73. <td width="50%">位置:外部接口 &gt; <a href="MemberConnect.php<?=$ecms_hashur['whehref']?>">管理外部登录接口</a> </td>
  74. <td><div align="right" class="emenubutton"></div></td>
  75. </tr>
  76. </table>
  77. <br>
  78. <table width="800" border="0" cellpadding="3" cellspacing="1" class="tableborder">
  79. <tr class="header">
  80. <td width="7%"><div align="center">ID</div></td>
  81. <td width="32%"><div align="center">接口名称</div></td>
  82. <td width="10%"><div align="center">状态</div></td>
  83. <td width="17%" height="25"><div align="center">接口类型</div></td>
  84. <td width="10%"><div align="center">绑定人数</div></td>
  85. <td width="10%"><div align="center">登录次数</div></td>
  86. <td width="14%" height="25"><div align="center">操作</div></td>
  87. </tr>
  88. <?php
  89. while($r=$empire->fetch($sql))
  90. {
  91. $membernum=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsmember_connect where apptype='$r[apptype]' limit 1");
  92. $loginnum=$empire->gettotal("select sum(loginnum) as total from {$dbtbpre}enewsmember_connect where apptype='$r[apptype]' limit 1");
  93. ?>
  94. <tr bgcolor="#FFFFFF" onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#C3EFFF'">
  95. <td align="center"><?=$r['id']?></td>
  96. <td height="38" align="center">
  97. <?=$r['appname']?> </td>
  98. <td><div align="center">
  99. <?=$r['isclose']==0?'开启':'关闭'?>
  100. </div></td>
  101. <td height="38"> <div align="center">
  102. <?=$r['apptype']?>
  103. </div></td>
  104. <td><div align="center"><?=$membernum?></div></td>
  105. <td><div align="center"><?=intval($loginnum)?></div></td>
  106. <td height="38"> <div align="center"><a href="SetMemberConnect.php?enews=EditMemberConnect&id=<?=$r['id']?><?=$ecms_hashur['ehref']?>">配置接口</a></div></td>
  107. </tr>
  108. <?php
  109. }
  110. db_close();
  111. $empire=null;
  112. ?>
  113. </table>
  114. </body>
  115. </html>