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 e1cc3347f..b44e1552e 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 @@ -12,7 +12,7 @@ class Support_Group{ ////////////////////////////////////////////Functions//////////////////////////////////////////////////// - //return all groups + //return group public static function getGroup($id) { $dbl = new DBLayer("lib"); $statement = $dbl->execute("SELECT * FROM support_group WHERE SGroupId = :id", array('id' => $id)); @@ -234,8 +234,8 @@ class Support_Group{ //update private data to DB. public function update(){ $dbl = new DBLayer("lib"); - $query = "UPDATE `support_group` SET `Name` = :name, `Tag` = :tag WHERE `SGroupId` = :id"; - $values = Array('id' => $this->getSGroupId(), 'name' => $this->getName(), 'tag' => $this->getTag() ); + $query = "UPDATE `support_group` SET `Name` = :name, `Tag` = :tag, `GroupEmail` = :groupemail, `IMAP_MailServer` = :mailserver, `IMAP_Username` = :username, `IMAP_Password` = :password WHERE `SGroupId` = :id"; + $values = Array('id' => $this->getSGroupId(), 'name' => $this->getName(), 'tag' => $this->getTag(), 'groupemail' => $this->getGroupEmail(), 'mailserver' => $this->getIMAP_MailServer(), 'username' => $this->getIMAP_Username(), 'password' => $this->getIMAP_Password() ); $statement = $dbl->execute($query, $values); } diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php index d5ba0963a..8d07283e6 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/users.php @@ -192,7 +192,7 @@ class Users{ * @takes $email * @return true or false depending on if its a valid email format. */ - private function validEmail( $email ){ + public function validEmail( $email ){ $isValid = true; $atIndex = strrpos( $email, "@" ); if ( is_bool( $atIndex ) && !$atIndex ){ diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini index 90619bcfc..02de8c019 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/en.ini @@ -53,6 +53,9 @@ user_already_added = "The user is already part of the group!" group_not_existing = "The group doesn't exist!" user_not_existing = "The user doesn't seem to exist" not_mod_or_admin = "You can only add Moderators or Admins!" +modify_mail_of_group_success = "The Support Group's email settings have been modified!" +email_not_valid = "The group email address is invalid!" +no_password_given = "There was no password filled in!" [sgroup_list] group_success = "The group has been created!" diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini index 9127fd0a3..e28bc311a 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/translations/fr.ini @@ -49,6 +49,10 @@ user_already_added = "cet user est deja membre de la groupe!" group_not_existing = "cet Groupe n' existe pas!" user_not_existing = "cet user n'existe pas" not_mod_or_admin = "C'est possible d'ajoute seulement des mods et admins!" +modify_mail_of_group_success = "Les parametres de messagerie du Groupe d'appui ont ete modifies!" +email_not_valid = "L'adresse email de groupe est invalide!" +no_password_given = "Il'n y a pas une passport!" + [sgroup_list] group_success = "le group est cree!" diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/func/modify_email_of_sgroup.php b/code/ryzom/tools/server/ryzom_ams/www/html/func/modify_email_of_sgroup.php new file mode 100644 index 000000000..ff028864b --- /dev/null +++ b/code/ryzom/tools/server/ryzom_ams/www/html/func/modify_email_of_sgroup.php @@ -0,0 +1,49 @@ +setGroupEmail($groupemail); + $group->setIMAP_MailServer(filter_var($_POST['IMAP_MailServer'],FILTER_SANITIZE_STRING)); + $group->setIMAP_Username(filter_var($_POST['IMAP_Username'],FILTER_SANITIZE_STRING)); + $group->setIMAP_Password($password); + $group->update(); + $result['RESULT_OF_MODIFYING'] = "SUCCESS"; + }else{ + $result['RESULT_OF_MODIFYING'] = "NO_PASSWORD"; + } + }else{ + $result['RESULT_OF_MODIFYING'] = "EMAIL_NOT_VALID"; + } + + $result['permission'] = $_SESSION['ticket_user']->getPermission(); + $result['no_visible_elements'] = 'FALSE'; + $result['username'] = $_SESSION['user']; + global $SITEBASE; + require_once($SITEBASE . 'inc/show_sgroup.php'); + $result= array_merge($result, show_sgroup()); + helpers :: loadtemplate( 'show_sgroup', $result); + exit; + + }else{ + //ERROR: No access! + $_SESSION['error_code'] = "403"; + header("Location: index.php?page=error"); + exit; + } + }else{ + //ERROR: not logged in! + header("Location: index.php"); + exit; + } + +} \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php index f4f5edd64..1c9ab406f 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_sgroup.php @@ -21,8 +21,10 @@ function show_sgroup(){ } $group = Support_Group::getGroup($result['target_id']); - $result['groupsname'] = $group->getName(); + $result['groupemail'] = $group->getGroupEmail(); + $result['imap_mailserver'] = $group->getIMAP_MailServer(); + $result['imap_username'] = $group->getIMAP_Username(); $result['userlist'] = Gui_Elements::make_table(Support_Group::getAllUsersOfSupportGroup($result['target_id']), Array("getTUserId","getPermission","getExternId"), Array("tUserId","permission","externId")); $i = 0; foreach( $result['userlist'] as $user){ diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_sgroup.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_sgroup.tpl index 15c1d7b80..cd6913a2f 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_sgroup.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_sgroup.tpl @@ -10,7 +10,7 @@
- All members of the {$groupsname} Support Group + {$groupsname} Support Group Members @@ -49,7 +49,7 @@ - Add a user to the group '{$groupsname}' + Add user to '{$groupsname}'
@@ -95,6 +95,83 @@
+
+

Modify Email Settings

+
+ + +
+
+
+
+ + + + Mail settings of '{$groupsname}' + +
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+
+ + + + +
+ +
+ +
+
+ + {if isset($RESULT_OF_MODIFYING) and $RESULT_OF_MODIFYING eq "SUCCESS"} +
+ {$modify_mail_of_group_success} +
+ {else if isset($RESULT_OF_MODIFYING) and $RESULT_OF_MODIFYING eq "EMAIL_NOT_VALID"} +
+ {$email_not_valid} +
+ {else if isset($RESULT_OF_MODIFYING) and $RESULT_OF_MODIFYING eq "NO_PASSWORD"} +
+ {$no_password_given} +
+ {/if} + + +
+
{/if}