Exemplo n.º 1
0
 /**
  *
  *
  * @author  John.meng (цот╤РШ)
  * @since   version - 2005-12-26 21:02:50
  * @param   string  
  *
  */
 function opGroupUser()
 {
     global $__Lang__, $UrlParameter, $SiteDB, $AddIPObj, $FlushPHPObj, $form, $smarty;
     parent::opAdd();
     $form->addElement('header', null, $__Lang__['langUserGroup'] . $__Lang__['langMenuUser'] . $__Lang__['langGeneralList']);
     $thisDAO = new GroupDAO();
     $all_group = $thisDAO->getAllGroup();
     $userDAO = new UserDAO();
     $from_arr = $userDAO->getNotGroupUsers();
     $tmp =& $form->addElement('multiChooser', 'users', 'Select ' . $__Lang__['langUserGroup'] . $__Lang__['langMenuUser'], array("All Users", "Group Users"), $from_arr, array());
     $tmp->addOptionPicker("From Group", $all_group);
     $form->addElement('hidden', 'Module', $_REQUEST['Module']);
     $form->addElement('hidden', 'Page', $_REQUEST['Page']);
     $form->addElement('hidden', 'Action', $_REQUEST['Action']);
     $form->addElement('submit', 'btnSubmit', $__Lang__['langGeneralSubmit']);
     if ($form->validate()) {
         $record["AddIP"] = $AddIPObj->getTrueIP();
         $record["CreateTime"] = time();
         $record["GroupsID"] = $_POST['usersPICKER'];
         $users_arr = explode(';', $_POST['users']);
         array_pop($users_arr);
         $thisDAO =& new GroupDAO();
         $user_arr = $thisDAO->autoUpdateInsertDel(UGROUPS_TABLE, $record, 'UsersID', implode(',', $users_arr), 'GroupsID', $_POST['usersPICKER']);
     }
     $smarty->assign("Main", $form->toHTML());
 }