diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/support_group.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/support_group.php index 4ee3e79fe..e1cc3347f 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/support_group.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/support_group.php @@ -5,6 +5,10 @@ class Support_Group{ private $sGroupId; private $name; private $tag; + private $groupEmail; + private $iMAP_MailServer; + private $iMAP_Username; + private $iMAP_Password; ////////////////////////////////////////////Functions//////////////////////////////////////////////////// @@ -35,15 +39,21 @@ class Support_Group{ } //wrapper for creating a support group - public static function createSupportGroup( $name, $tag) { + public static function createSupportGroup( $name, $tag, $groupemail, $imap_mailserver, $imap_username, $imap_password) { if(strlen($name) < 21 && strlen($name) > 4 &&strlen($tag) < 8 && strlen($tag) > 1 ){ $notExists = self::supportGroup_EntryNotExists($name, $tag); if ( $notExists == "SUCCESS" ){ $sGroup = new self(); - $sGroup->setName($name); - $sGroup->setTag($tag); + $values = array('Name' => $name, 'Tag' => $tag, 'GroupEmail' => $groupemail, 'IMAP_MailServer' => $imap_mailserver, 'IMAP_Username' => $imap_username, 'IMAP_Password' => $imap_password); + $sGroup->setName($values['Name']); + $sGroup->setTag($values['Tag']); + $sGroup->setGroupEmail($values['GroupEmail']); + $sGroup->setIMAP_MailServer($values['IMAP_MailServer']); + $sGroup->setIMAP_Username($values['IMAP_Username']); + $sGroup->setIMAP_Password($values['IMAP_Password']); $sGroup->create(); + return "SUCCESS"; }else{ //return NAME_TAKEN or TAG_TAKEN @@ -199,12 +209,16 @@ class Support_Group{ $this->setSGroupId($values['SGroupId']); $this->setName($values['Name']); $this->setTag($values['Tag']); + $this->setGroupEmail($values['GroupEmail']); + $this->setIMAP_MailServer($values['IMAP_MailServer']); + $this->setIMAP_Username($values['IMAP_Username']); + $this->setIMAP_Password($values['IMAP_Password']); } public function create() { $dbl = new DBLayer("lib"); - $query = "INSERT INTO support_group (Name, Tag) VALUES (:name, :tag)"; - $values = Array('name' => $this->name, 'tag' => $this->tag); + $query = "INSERT INTO support_group (Name, Tag, GroupEmail, IMAP_MailServer, IMAP_Username, IMAP_Password) VALUES (:name, :tag, :groupemail, :imap_mailserver, :imap_username, :imap_password)"; + $values = Array('name' => $this->getName(), 'tag' => $this->getTag(), 'groupemail' => $this->getGroupEmail(), 'imap_mailserver' => $this->getIMAP_MailServer(), 'imap_username' => $this->getIMAP_Username(), 'imap_password' => $this->getIMAP_Password()); $dbl->execute($query, $values); } @@ -247,6 +261,21 @@ class Support_Group{ return $this->tag; } + public function getGroupEmail(){ + return $this->groupEmail; + } + + public function getIMAP_MailServer(){ + return $this->iMAP_MailServer; + } + + public function getIMAP_Username(){ + return $this->iMAP_Username; + } + + public function getIMAP_Password(){ + return $this->iMap_Password; + } ////////////////////////////////////////////Setters//////////////////////////////////////////////////// public function setSGroupId($id){ @@ -261,5 +290,19 @@ class Support_Group{ $this->tag = $t; } + public function setGroupEmail($ge){ + $this->groupEmail = $ge; + } + public function setIMAP_MailServer($ms){ + $this->iMAP_MailServer = $ms; + } + + public function setIMAP_Username($u){ + $this->iMAP_Username = $u; + } + + public function setIMAP_Password($p){ + $this->iMap_Password = $p; + } } \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/www/config.php b/code/ryzom/tools/server/ryzom_ams/www/config.php index 82c010e58..4112b9f32 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/config.php +++ b/code/ryzom/tools/server/ryzom_ams/www/config.php @@ -57,13 +57,21 @@ $CREATE_RING = true ; $AMS_LIB = dirname( dirname( __FILE__ ) ) . '/ams_lib'; $AMS_TRANS = $AMS_LIB . '/translations'; $AMS_CACHEDIR = $AMS_LIB . '/cache'; - -$DEFAULT_LANGUAGE = 'en'; - $SITEBASE = dirname( __FILE__ ) . '/html/' ; +//defines the default language +$DEFAULT_LANGUAGE = 'en'; + +//defines if logging actions should happen or not. $TICKET_LOGGING = true; -$TICKET_MAILING_SUPPORT = true; + +//defines the time format display $TIME_FORMAT = "m-d-Y H:i:s"; + +//defines which ingame layout template should be used $INGAME_LAYOUT = "basic"; + +//Defines mailing related stuff +$SUPPORT_GROUP_IMAP_CRYPTKEY = "azerty"; +$TICKET_MAILING_SUPPORT = true; $MAIL_DIR = "/tmp"; diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/func/add_sgroup.php b/code/ryzom/tools/server/ryzom_ams/www/html/func/add_sgroup.php index 9fc59d917..4a5ff8452 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/func/add_sgroup.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/func/add_sgroup.php @@ -8,8 +8,13 @@ function add_sgroup(){ $name = filter_var($_POST['Name'],FILTER_SANITIZE_STRING); $inner_tag = filter_var($_POST['Tag'], FILTER_SANITIZE_STRING); $tag = "[" . $inner_tag . "]"; + $inner_tag = filter_var($_POST['Tag'], FILTER_SANITIZE_STRING); + $groupemail = filter_var($_POST['GroupEmail'], FILTER_SANITIZE_STRING); + $imap_mailserver = filter_var($_POST['IMAP_MailServer'], FILTER_SANITIZE_STRING); + $imap_username = filter_var($_POST['IMAP_Username'], FILTER_SANITIZE_STRING); + $imap_password = filter_var($_POST['IMAP_Password'], FILTER_SANITIZE_STRING); - $result['RESULT_OF_ADDING'] = Support_Group::createSupportGroup($name, $tag); + $result['RESULT_OF_ADDING'] = Support_Group::createSupportGroup($name, $tag, $groupemail, $imap_mailserver, $imap_username, $imap_password); $result['permission'] = $_SESSION['ticket_user']->getPermission(); $result['no_visible_elements'] = 'FALSE'; $result['username'] = $_SESSION['user']; diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php index 3d380c2d2..f9c2ac150 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/sgroup_list.php @@ -14,7 +14,7 @@ function sgroup_list(){ if(Ticket_User::isAdmin($_SESSION['ticket_user'])){ $result['isAdmin'] = "TRUE"; } - $result['grouplist'] = Gui_Elements::make_table(Support_Group::getGroups(), Array("getSGroupId","getName","getTag"), Array("sGroupId","name","tag")); + $result['grouplist'] = Gui_Elements::make_table(Support_Group::getGroups(), Array("getSGroupId","getName","getTag","getGroupEmail"), Array("sGroupId","name","tag","groupemail")); return $result; }else{ //ERROR: No access! diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/sql/install.php b/code/ryzom/tools/server/ryzom_ams/www/html/sql/install.php index cf8a514e4..6a49cf8bd 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/sql/install.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/sql/install.php @@ -286,6 +286,10 @@ `SGroupId` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT , `Name` VARCHAR(22) NOT NULL , `Tag` VARCHAR(7) NOT NULL , + `GroupEmail` VARCHAR(45) NULL , + `IMAP_MailServer` VARCHAR(60) NULL , + `IMAP_Username` VARCHAR(45) NULL , + `IMAP_Password` VARCHAR(45) NULL , PRIMARY KEY (`SGroupId`) , UNIQUE INDEX `Name_UNIQUE` (`Name` ASC) , UNIQUE INDEX `Tag_UNIQUE` (`Tag` ASC) ) diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/sql/ticketsql.sql b/code/ryzom/tools/server/ryzom_ams/www/html/sql/ticketsql.sql index e7864e628..905f8f693 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/sql/ticketsql.sql +++ b/code/ryzom/tools/server/ryzom_ams/www/html/sql/ticketsql.sql @@ -241,6 +241,10 @@ CREATE TABLE IF NOT EXISTS `mydb`.`support_group` ( `SGroupId` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT , `Name` VARCHAR(22) NOT NULL , `Tag` VARCHAR(7) NOT NULL , + `GroupEmail` VARCHAR(45) NULL , + `IMAP_MailServer` VARCHAR(60) NULL , + `IMAP_Username` VARCHAR(45) NULL , + `IMAP_Password` VARCHAR(45) NULL , PRIMARY KEY (`SGroupId`) , UNIQUE INDEX `Name_UNIQUE` (`Name` ASC) , UNIQUE INDEX `Tag_UNIQUE` (`Tag` ASC) ) diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/sql/ticketsystemmodel.mwb b/code/ryzom/tools/server/ryzom_ams/www/html/sql/ticketsystemmodel.mwb index baf11d335..cc8aec0c2 100644 Binary files a/code/ryzom/tools/server/ryzom_ams/www/html/sql/ticketsystemmodel.mwb and b/code/ryzom/tools/server/ryzom_ams/www/html/sql/ticketsystemmodel.mwb differ diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/sgroup_list.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/sgroup_list.tpl index 57ab6e01f..a139aec34 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/sgroup_list.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/sgroup_list.tpl @@ -19,6 +19,7 @@ ID Name Tag + Email {if isset($isAdmin) && $isAdmin eq 'TRUE'}Action{/if} @@ -28,6 +29,7 @@ {$group.sGroupId} {$group.name} {$group.tag} + {$group.groupemail} {if isset($isAdmin) && $isAdmin eq 'TRUE'} Delete{/if} {/foreach} @@ -71,6 +73,42 @@ +
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+
+