@@ -24,8 +24,9 @@ |
||
| 24 | 24 | |
| 25 | 25 | // Actions |
| 26 | 26 | if (isset ($_GET['action'])) { |
| 27 | - if ($_GET['action'] == 'show_message') |
|
| 28 | - Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); |
|
| 27 | + if ($_GET['action'] == 'show_message') { |
|
| 28 | + Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); |
|
| 29 | + } |
|
| 29 | 30 | Security::clear_token(); |
| 30 | 31 | } |
| 31 | 32 | |
@@ -144,7 +144,10 @@ |
||
| 144 | 144 | echo '</div>'; |
| 145 | 145 | ?> |
| 146 | 146 | |
| 147 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
| 147 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) { |
|
| 148 | + echo '&add=true' ; |
|
| 149 | +} |
|
| 150 | +?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
| 148 | 151 | <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>'; |
| 149 | 152 | |
| 150 | 153 | if ($add_type=='multiple') { |
@@ -119,7 +119,10 @@ discard block |
||
| 119 | 119 | <td width="40%" align="center"> |
| 120 | 120 | <select name="course_list[]" multiple="multiple" size="20" style="width:400px;"> |
| 121 | 121 | <?php foreach ($db_courses as $course) { ?> |
| 122 | - <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) echo 'selected="selected"'; ?>><?php echo $course['title'].' ('.$course['code'].')'; ?> |
|
| 122 | + <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) { |
|
| 123 | + echo 'selected="selected"'; |
|
| 124 | +} |
|
| 125 | +?>><?php echo $course['title'].' ('.$course['code'].')'; ?> |
|
| 123 | 126 | </option> |
| 124 | 127 | <?php } ?> |
| 125 | 128 | </select> |
@@ -130,7 +133,10 @@ discard block |
||
| 130 | 133 | <td width="40%" align="center"> |
| 131 | 134 | <select name="url_list[]" multiple="multiple" size="20" style="width:300px;"> |
| 132 | 135 | <?php foreach ($db_urls as $url_obj) { ?> |
| 133 | - <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) echo 'selected="selected"'; ?>><?php echo $url_obj['url']; ?> |
|
| 136 | + <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) { |
|
| 137 | + echo 'selected="selected"'; |
|
| 138 | +} |
|
| 139 | +?>><?php echo $url_obj['url']; ?> |
|
| 134 | 140 | </option> |
| 135 | 141 | <?php } ?> |
| 136 | 142 | </select> |
@@ -63,8 +63,7 @@ discard block |
||
| 63 | 63 | echo '</form>'; |
| 64 | 64 | echo '</div>'; |
| 65 | 65 | |
| 66 | -} |
|
| 67 | -elseif(!empty($annee) && empty($id_session)) |
|
| 66 | +} elseif(!empty($annee) && empty($id_session)) |
|
| 68 | 67 | { |
| 69 | 68 | Display::display_header($tool_name); |
| 70 | 69 | echo '<div style="align:center">'; |
@@ -142,8 +141,7 @@ discard block |
||
| 142 | 141 | echo '<br /><br />'; |
| 143 | 142 | echo '</div>'; |
| 144 | 143 | |
| 145 | -} |
|
| 146 | -elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes')) |
|
| 144 | +} elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes')) |
|
| 147 | 145 | { |
| 148 | 146 | $id=$_POST['username_form']; |
| 149 | 147 | $UserList=array(); |
@@ -118,7 +118,10 @@ discard block |
||
| 118 | 118 | <?php |
| 119 | 119 | foreach ($db_users as $user) { |
| 120 | 120 | ?> |
| 121 | - <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'], $users)) echo 'selected="selected"'; ?>> |
|
| 121 | + <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'], $users)) { |
|
| 122 | + echo 'selected="selected"'; |
|
| 123 | +} |
|
| 124 | +?>> |
|
| 122 | 125 | <?php echo api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; ?> |
| 123 | 126 | </option> |
| 124 | 127 | <?php |
@@ -134,7 +137,10 @@ discard block |
||
| 134 | 137 | <?php |
| 135 | 138 | foreach ($db_urls as $url_obj) { |
| 136 | 139 | ?> |
| 137 | - <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) echo 'selected="selected"'; ?>> |
|
| 140 | + <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) { |
|
| 141 | + echo 'selected="selected"'; |
|
| 142 | +} |
|
| 143 | +?>> |
|
| 138 | 144 | <?php echo $url_obj['url']; ?> |
| 139 | 145 | </option> |
| 140 | 146 | <?php |
@@ -118,8 +118,7 @@ |
||
| 118 | 118 | if (isset($included) && ($included)) |
| 119 | 119 | { |
| 120 | 120 | $message .= "> $name_session: ".count($UserAdd)." ".get_lang('Added').' '.get_lang('And').' '.count($UserUpdate).' '.get_lang('Modified').'<br/>'; |
| 121 | - } |
|
| 122 | - else |
|
| 121 | + } else |
|
| 123 | 122 | { |
| 124 | 123 | print "> $name_session: ".count($UserAdd).get_lang('Added').' '.get_lang('And').' '.count($UserUpdate).' '.get_lang('Modified')."\n"; |
| 125 | 124 | } |
@@ -505,8 +505,14 @@ |
||
| 505 | 505 | <p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p> |
| 506 | 506 | <blockquote> |
| 507 | 507 | <pre> |
| 508 | -<b>LastName</b>;<b>FirstName</b>;<b>Email</b>;UserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate;<span style="color:red;"><?php if (count($list) > 0) echo implode(';', $list).';'; ?></span>Courses;ClassId; |
|
| 509 | -<b>xxx</b>;<b>xxx</b>;<b>xxx</b>;xxx;xxx;<?php echo implode('/', $defined_auth_sources); ?>;xxx;xxx;user/teacher/drh;0000-00-00 00:00:00;<span style="color:red;"><?php if (count($list_reponse) > 0) echo implode(';', $list_reponse).';'; ?></span>xxx1|xxx2|xxx3;1;<br /> |
|
| 508 | +<b>LastName</b>;<b>FirstName</b>;<b>Email</b>;UserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate;<span style="color:red;"><?php if (count($list) > 0) { |
|
| 509 | + echo implode(';', $list).';'; |
|
| 510 | +} |
|
| 511 | +?></span>Courses;ClassId; |
|
| 512 | +<b>xxx</b>;<b>xxx</b>;<b>xxx</b>;xxx;xxx;<?php echo implode('/', $defined_auth_sources); ?>;xxx;xxx;user/teacher/drh;0000-00-00 00:00:00;<span style="color:red;"><?php if (count($list_reponse) > 0) { |
|
| 513 | + echo implode(';', $list_reponse).';'; |
|
| 514 | +} |
|
| 515 | +?></span>xxx1|xxx2|xxx3;1;<br /> |
|
| 510 | 516 | </pre> |
| 511 | 517 | </blockquote> |
| 512 | 518 | <p><?php echo get_lang('XMLMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p> |
@@ -244,8 +244,7 @@ |
||
| 244 | 244 | </button> |
| 245 | 245 | </div> |
| 246 | 246 | <?php |
| 247 | - } |
|
| 248 | - else |
|
| 247 | + } else |
|
| 249 | 248 | { |
| 250 | 249 | ?> |
| 251 | 250 | <div class="separate-action"> |
@@ -51,8 +51,7 @@ discard block |
||
| 51 | 51 | if ($user_id != $_user['user_id'] && UserManager :: delete_user($_GET['user_id'])) |
| 52 | 52 | { |
| 53 | 53 | Display :: display_normal_message(get_lang('UserDeleted')); |
| 54 | - } |
|
| 55 | - else |
|
| 54 | + } else |
|
| 56 | 55 | { |
| 57 | 56 | Display :: display_error_message(get_lang('CannotDeleteUser')); |
| 58 | 57 | } |
@@ -88,8 +87,7 @@ discard block |
||
| 88 | 87 | { |
| 89 | 88 | $message .= '- '.$login.'<br />'; |
| 90 | 89 | } |
| 91 | - } |
|
| 92 | - else |
|
| 90 | + } else |
|
| 93 | 91 | { |
| 94 | 92 | $message=get_lang('NoUserAdded'); |
| 95 | 93 | } |
@@ -100,13 +98,11 @@ discard block |
||
| 100 | 98 | Display :: display_header($tool_name); |
| 101 | 99 | } |
| 102 | 100 | Security::clear_token(); |
| 103 | - } |
|
| 104 | - else |
|
| 101 | + } else |
|
| 105 | 102 | { |
| 106 | 103 | Display::display_header($tool_name); |
| 107 | 104 | } |
| 108 | -} |
|
| 109 | -else |
|
| 105 | +} else |
|
| 110 | 106 | { |
| 111 | 107 | Display::display_header($tool_name); |
| 112 | 108 | } |
@@ -133,8 +129,7 @@ discard block |
||
| 133 | 129 | if($number_of_selected_users == $number_of_deleted_users) |
| 134 | 130 | { |
| 135 | 131 | Display :: display_normal_message(get_lang('SelectedUsersDeleted')); |
| 136 | - } |
|
| 137 | - else |
|
| 132 | + } else |
|
| 138 | 133 | { |
| 139 | 134 | Display :: display_error_message(get_lang('SomeUsersNotDeleted')); |
| 140 | 135 | } |
@@ -150,13 +145,13 @@ discard block |
||
| 150 | 145 | $UserList[] = ldap_add_user($user_id); |
| 151 | 146 | } |
| 152 | 147 | } |
| 153 | - if (isset($_GET['id_session']) && (trim($_GET['id_session'])!="")) |
|
| 154 | - addUserToSession($UserList, $_GET['id_session']); |
|
| 148 | + if (isset($_GET['id_session']) && (trim($_GET['id_session'])!="")) { |
|
| 149 | + addUserToSession($UserList, $_GET['id_session']); |
|
| 150 | + } |
|
| 155 | 151 | if(count($UserList)>0) |
| 156 | 152 | { |
| 157 | 153 | Display :: display_normal_message(count($UserList)." ".get_lang('LDAPUsersAdded')); |
| 158 | - } |
|
| 159 | - else |
|
| 154 | + } else |
|
| 160 | 155 | { |
| 161 | 156 | Display :: display_normal_message(get_lang('NoUserAdded')); |
| 162 | 157 | } |
@@ -173,14 +168,14 @@ discard block |
||
| 173 | 168 | { |
| 174 | 169 | $form->addText('keyword_firstname', get_lang('FirstName'), false); |
| 175 | 170 | $form->addText('keyword_lastname', get_lang('LastName'), false); |
| 176 | -} |
|
| 177 | -else |
|
| 171 | +} else |
|
| 178 | 172 | { |
| 179 | 173 | $form->addText('keyword_lastname',get_lang('LastName'),false); |
| 180 | 174 | $form->addText('keyword_firstname',get_lang('FirstName'),false); |
| 181 | 175 | } |
| 182 | -if (isset($_GET['id_session'])) |
|
| 176 | +if (isset($_GET['id_session'])) { |
|
| 183 | 177 | $form->addElement('hidden','id_session',$_GET['id_session']); |
| 178 | +} |
|
| 184 | 179 | |
| 185 | 180 | $type = array(); |
| 186 | 181 | $type["all"] = get_lang('All'); |
@@ -201,8 +196,9 @@ discard block |
||
| 201 | 196 | $parameters['keyword_firstname'] = @$_GET['keyword_firstname'] ?: null; |
| 202 | 197 | $parameters['keyword_lastname'] = @$_GET['keyword_lastname'] ?: null; |
| 203 | 198 | $parameters['keyword_email'] = @$_GET['keyword_email'] ?: null; |
| 204 | -if (isset($_GET['id_session'])) |
|
| 199 | +if (isset($_GET['id_session'])) { |
|
| 205 | 200 | $parameters['id_session'] = $_GET['id_session']; |
| 201 | +} |
|
| 206 | 202 | // Create a sortable table with user-data |
| 207 | 203 | |
| 208 | 204 | $parameters['sec_token'] = Security::get_token(); |
@@ -214,8 +210,7 @@ discard block |
||
| 214 | 210 | { |
| 215 | 211 | $table->set_header(2, get_lang('FirstName')); |
| 216 | 212 | $table->set_header(3, get_lang('LastName')); |
| 217 | -} |
|
| 218 | -else |
|
| 213 | +} else |
|
| 219 | 214 | { |
| 220 | 215 | $table->set_header(2, get_lang('LastName')); |
| 221 | 216 | $table->set_header(3, get_lang('FirstName')); |