txcloudAction.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. class txcloudClassAction extends Action
  3. {
  4. public function setsaveAjax()
  5. {
  6. $secretid = $this->post('secretid');
  7. $secretkey = $this->post('secretkey');
  8. if(!contain($secretid,'****'))
  9. $this->option->setval('txcloud_secretid@-6', $this->jm->encrypt($secretid));
  10. if(!contain($secretkey,'****'))
  11. $this->option->setval('txcloud_secretkey@-6', $this->jm->encrypt($secretkey));
  12. $this->option->setval('txcloud_rlroupid@-6', $this->post('rlroupid'));
  13. $this->backmsg();
  14. }
  15. public function getsetAjax()
  16. {
  17. $arr= array();
  18. $arr['secretid'] = $this->option->getval('txcloud_secretid');
  19. $arr['secretkey'] = $this->option->getval('txcloud_secretkey');
  20. $arr['rlroupid'] = $this->option->getval('txcloud_rlroupid');
  21. if(!isempt($arr['secretid'])){
  22. $secretid = $this->jm->uncrypt($arr['secretid']);
  23. $arr['secretid'] = substr($secretid,0,5).'******'.substr($secretid,-5);
  24. }
  25. if(!isempt($arr['secretkey'])){
  26. $secretkey = $this->jm->uncrypt($arr['secretkey']);
  27. $arr['secretkey'] = substr($secretkey,0,5).'******'.substr($secretkey,-5);
  28. }
  29. echo json_encode($arr);
  30. }
  31. //获取
  32. public function reloaduserAjax()
  33. {
  34. return m('txcloud:renlian')->GetPersonList();
  35. }
  36. //删除
  37. public function delrenlianAjax()
  38. {
  39. return m('txcloud:renlian')->deleteRenlian((int)$this->post('id','0'));
  40. }
  41. public function beforeuserdshow($table)
  42. {
  43. $where = '';
  44. $key = $this->post('key');
  45. if(!isempt($key))$where=" and (a.`personname` like '%$key%' or b.`deptallname` like '%$key%')";
  46. return array(
  47. 'where' => $where,
  48. 'fields'=> 'a.*,b.name,b.deptallname',
  49. 'table' => '`[Q]'.$table.'` a left join `[Q]admin` b on a.uid=b.id'
  50. );
  51. }
  52. public function aftereuserdshow($table, $rows)
  53. {
  54. foreach($rows as $k=>$rs){
  55. if($rs['uid']>0 && $rs['personname']!=$rs['name']){
  56. $rows[$k]['name'].='<font color=red>,关联的姓名不一样</font>';
  57. }
  58. if(!isempt($rs['faceids']))$rows[$k]['imgshu'] = count(explode(',', $rs['faceids']));
  59. }
  60. return array(
  61. 'rows' => $rows
  62. );
  63. }
  64. //创建用户
  65. public function createurenlianAjax()
  66. {
  67. return m('txcloud:renlian')->createUser(array(
  68. 'id' => (int)$this->post('id'),
  69. 'uid' => (int)$this->post('uid'),
  70. 'personname' => $this->post('personname'),
  71. 'imgurl' => $this->post('imgurl'),
  72. ));
  73. }
  74. }
粤ICP备19079148号