@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | $cidReset = true; |
11 | 11 | require_once '../inc/global.inc.php'; |
12 | 12 | |
13 | -$this_section=SECTION_PLATFORM_ADMIN; |
|
13 | +$this_section = SECTION_PLATFORM_ADMIN; |
|
14 | 14 | |
15 | 15 | api_protect_global_admin_script(); |
16 | 16 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | $form_sent = 0; |
23 | 23 | $first_letter_course = ''; |
24 | -$courses = array (); |
|
24 | +$courses = array(); |
|
25 | 25 | $url_list = array(); |
26 | 26 | $users = array(); |
27 | 27 | |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | |
33 | 33 | /* Header */ |
34 | 34 | $tool_name = get_lang('AddCoursesToURL'); |
35 | -$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
36 | -$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs')); |
|
35 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
36 | +$interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs')); |
|
37 | 37 | |
38 | 38 | Display :: display_header($tool_name); |
39 | 39 | |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | |
49 | 49 | if (isset($_POST['form_sent']) && $_POST['form_sent']) { |
50 | 50 | $form_sent = $_POST['form_sent']; |
51 | - $courses = is_array($_POST['course_list']) ? $_POST['course_list'] : array() ; |
|
52 | - $url_list = is_array($_POST['url_list']) ? $_POST['url_list'] : array() ; |
|
51 | + $courses = is_array($_POST['course_list']) ? $_POST['course_list'] : array(); |
|
52 | + $url_list = is_array($_POST['url_list']) ? $_POST['url_list'] : array(); |
|
53 | 53 | $first_letter_course = $_POST['first_letter_course']; |
54 | 54 | |
55 | 55 | foreach ($users as $key => $value) { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $sql = "SELECT count(*) as num_courses FROM $tbl_course"; |
71 | 71 | $result = Database::query($sql); |
72 | 72 | $num_row = Database::fetch_array($result); |
73 | - if ($num_row['num_courses']>1000) { |
|
73 | + if ($num_row['num_courses'] > 1000) { |
|
74 | 74 | //if there are too much num_courses to gracefully handle with the HTML select list, |
75 | 75 | // assign a default filter on users names |
76 | 76 | $first_letter_user = 'A'; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | <option value="">--</option> |
107 | 107 | <?php |
108 | 108 | echo Display :: get_alphabet_options($first_letter_course); |
109 | - echo Display :: get_numeric_options(0,9,$first_letter_course); |
|
109 | + echo Display :: get_numeric_options(0, 9, $first_letter_course); |
|
110 | 110 | ?> |
111 | 111 | </select> |
112 | 112 | </td> |
@@ -119,7 +119,7 @@ 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)) echo 'selected="selected"'; ?>><?php echo $course['title'].' ('.$course['code'].')'; ?> |
|
123 | 123 | </option> |
124 | 124 | <?php } ?> |
125 | 125 | </select> |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | <td width="40%" align="center"> |
131 | 131 | <select name="url_list[]" multiple="multiple" size="20" style="width:300px;"> |
132 | 132 | <?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']; ?> |
|
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']; ?> |
|
134 | 134 | </option> |
135 | 135 | <?php } ?> |
136 | 136 | </select> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * Code |
10 | 10 | */ |
11 | 11 | // resetting the course id |
12 | -$cidReset=true; |
|
12 | +$cidReset = true; |
|
13 | 13 | require_once('../inc/global.inc.php'); |
14 | 14 | // setting the section (for the tabs) |
15 | 15 | $this_section = SECTION_PLATFORM_ADMIN; |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | api_protect_admin_script(); |
18 | 18 | require('../auth/ldap/authldap.php'); |
19 | 19 | |
20 | -$annee_base=date('Y'); |
|
20 | +$annee_base = date('Y'); |
|
21 | 21 | |
22 | 22 | $tool_name = get_lang('LDAPImport'); |
23 | 23 | // setting breadcrumbs |
24 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
24 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
25 | 25 | |
26 | 26 | $htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript"> |
27 | 27 | var buttoncheck = 1; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | echo '</div>'; |
65 | 65 | |
66 | 66 | } |
67 | -elseif(!empty($annee) && empty($id_session)) |
|
67 | +elseif (!empty($annee) && empty($id_session)) |
|
68 | 68 | { |
69 | 69 | Display::display_header($tool_name); |
70 | 70 | echo '<div style="align:center">'; |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | echo '<select name="id_session">'; |
74 | 74 | |
75 | 75 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
76 | - $sql = "SELECT id,name,nbr_courses,access_start_date,access_end_date " . |
|
76 | + $sql = "SELECT id,name,nbr_courses,access_start_date,access_end_date ". |
|
77 | 77 | " FROM $tbl_session ". |
78 | 78 | " ORDER BY name"; |
79 | 79 | $result = Database::query($sql); |
80 | 80 | |
81 | - $sessions=Database::store_result($result); |
|
82 | - $nbr_results=count($sessions); |
|
83 | - foreach($sessions as $row) { |
|
81 | + $sessions = Database::store_result($result); |
|
82 | + $nbr_results = count($sessions); |
|
83 | + foreach ($sessions as $row) { |
|
84 | 84 | echo '<option value="'.$row['id'].'">'.api_htmlentities($row['name']).' ('.$row['access_start_date'].' - '.$row['access_end_date'].')</option>'; |
85 | 85 | } |
86 | 86 | echo '</select>'; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | $info = ldap_get_entries($ds, $sr); |
114 | 114 | |
115 | - for ($key = 0; $key < $info["count"]; $key ++) { |
|
115 | + for ($key = 0; $key < $info["count"]; $key++) { |
|
116 | 116 | $nom_form[] = $info[$key]["sn"][0]; |
117 | 117 | $prenom_form[] = $info[$key]["givenname"][0]; |
118 | 118 | $email_form[] = $info[$key]["mail"][0]; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | asort($nom_form); |
133 | 133 | reset($nom_form); |
134 | 134 | |
135 | - $statut=5; |
|
135 | + $statut = 5; |
|
136 | 136 | include ('ldap_form_add_users_group.php'); |
137 | 137 | } else { |
138 | 138 | echo '<h4>'.get_lang('UnableToConnectTo').' '.$host.'</h4>'; |
@@ -143,24 +143,24 @@ discard block |
||
143 | 143 | echo '</div>'; |
144 | 144 | |
145 | 145 | } |
146 | -elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes')) |
|
146 | +elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed'] == 'yes')) |
|
147 | 147 | { |
148 | - $id=$_POST['username_form']; |
|
149 | - $UserList=array(); |
|
148 | + $id = $_POST['username_form']; |
|
149 | + $UserList = array(); |
|
150 | 150 | $userid_match_login = array(); |
151 | 151 | foreach ($id as $form_index=>$user_id) |
152 | 152 | { |
153 | - if(is_array($_POST['checkboxes']) && in_array($form_index,array_values($_POST['checkboxes']))) |
|
153 | + if (is_array($_POST['checkboxes']) && in_array($form_index, array_values($_POST['checkboxes']))) |
|
154 | 154 | { |
155 | 155 | $tmp = ldap_add_user($user_id); |
156 | - $UserList[]= $tmp; |
|
156 | + $UserList[] = $tmp; |
|
157 | 157 | $userid_match_login[$tmp] = $user_id; |
158 | 158 | } |
159 | 159 | } |
160 | 160 | if (!empty($_POST['id_session'])) { |
161 | 161 | $num = 0; |
162 | 162 | $tbl_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
163 | - $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
|
163 | + $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
|
164 | 164 | foreach ($UserList as $user_id) { |
165 | 165 | $res_user = Database::insert( |
166 | 166 | $tbl_session_user, |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | } |
176 | 176 | } |
177 | 177 | |
178 | - if($num>0) { |
|
178 | + if ($num > 0) { |
|
179 | 179 | $sql = 'UPDATE '.$tbl_session.' SET nbr_users = (nbr_users + '.$num.') WHERE id = '.intval($id_session); |
180 | 180 | $res = Database::query($sql); |
181 | 181 | } |
@@ -203,8 +203,8 @@ discard block |
||
203 | 203 | else |
204 | 204 | { |
205 | 205 | Display::display_header($tool_name); |
206 | - $message=get_lang('NoUserAdded'); |
|
207 | - Display :: display_normal_message($message,false); |
|
206 | + $message = get_lang('NoUserAdded'); |
|
207 | + Display :: display_normal_message($message, false); |
|
208 | 208 | } |
209 | 209 | echo '<br /><br />'; |
210 | 210 | echo '<a href="ldap_import_students.php?annee=&composante=&etape=">'.get_lang('BackToNewSearch').'</a>'; |
@@ -20,24 +20,24 @@ discard block |
||
20 | 20 | $form_sent = 0; |
21 | 21 | $first_letter_user = ''; |
22 | 22 | $first_letter_course = ''; |
23 | -$courses = array (); |
|
23 | +$courses = array(); |
|
24 | 24 | $url_list = array(); |
25 | 25 | $users = array(); |
26 | 26 | |
27 | 27 | $tbl_access_url_rel_user = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
28 | 28 | $tbl_access_url = Database :: get_main_table(TABLE_MAIN_ACCESS_URL); |
29 | -$tbl_user = Database :: get_main_table(TABLE_MAIN_USER); |
|
29 | +$tbl_user = Database :: get_main_table(TABLE_MAIN_USER); |
|
30 | 30 | |
31 | 31 | /* Header */ |
32 | 32 | $tool_name = get_lang('AddUsersToURL'); |
33 | -$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
34 | -$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs')); |
|
33 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
34 | +$interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs')); |
|
35 | 35 | |
36 | 36 | Display :: display_header($tool_name); |
37 | 37 | |
38 | 38 | echo '<div class="actions">'; |
39 | 39 | echo Display::url( |
40 | - Display::return_icon('edit.png', get_lang('EditUsersToURL'),''), |
|
40 | + Display::return_icon('edit.png', get_lang('EditUsersToURL'), ''), |
|
41 | 41 | api_get_path(WEB_CODE_PATH).'admin/access_url_edit_users_to_url.php'); |
42 | 42 | echo '</div>'; |
43 | 43 | |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | |
46 | 46 | if ($_POST['form_sent']) { |
47 | 47 | $form_sent = $_POST['form_sent']; |
48 | - $users = is_array($_POST['user_list']) ? $_POST['user_list'] : array() ; |
|
49 | - $url_list = is_array($_POST['url_list']) ? $_POST['url_list'] : array() ; |
|
48 | + $users = is_array($_POST['user_list']) ? $_POST['user_list'] : array(); |
|
49 | + $url_list = is_array($_POST['url_list']) ? $_POST['url_list'] : array(); |
|
50 | 50 | $first_letter_user = $_POST['first_letter_user']; |
51 | 51 | |
52 | - foreach($users as $key => $value) { |
|
52 | + foreach ($users as $key => $value) { |
|
53 | 53 | $users[$key] = intval($value); |
54 | 54 | } |
55 | 55 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | if (count($users) == 0 || count($url_list) == 0) { |
58 | 58 | Display :: display_error_message(get_lang('AtLeastOneUserAndOneURL')); |
59 | 59 | } else { |
60 | - UrlManager::add_users_to_urls($users,$url_list); |
|
60 | + UrlManager::add_users_to_urls($users, $url_list); |
|
61 | 61 | Display :: display_confirmation_message(get_lang('UsersBelongURL')); |
62 | 62 | } |
63 | 63 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $sql = "SELECT count(*) as nb_users FROM $tbl_user"; |
69 | 69 | $result = Database::query($sql); |
70 | 70 | $num_row = Database::fetch_array($result); |
71 | - if ($num_row['nb_users']>1000) { |
|
71 | + if ($num_row['nb_users'] > 1000) { |
|
72 | 72 | //if there are too much users to gracefully handle with the HTML select list, |
73 | 73 | // assign a default filter on users names |
74 | 74 | $first_letter_user = 'A'; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | <td width="40%" align="center"> |
100 | 100 | <b><?php echo get_lang('UserList'); ?></b> |
101 | 101 | <br/><br/> |
102 | - <?php echo get_lang('Select').' ' ; echo $target_name == 'firstname'? get_lang('FirstName') : get_lang('LastName'); ?> |
|
102 | + <?php echo get_lang('Select').' '; echo $target_name == 'firstname' ? get_lang('FirstName') : get_lang('LastName'); ?> |
|
103 | 103 | <select name="first_letter_user" onchange="javascript:document.formulaire.form_sent.value='2'; document.formulaire.submit();"> |
104 | 104 | <option value="">--</option> |
105 | 105 | <?php |
@@ -118,7 +118,7 @@ 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)) echo 'selected="selected"'; ?>> |
|
122 | 122 | <?php echo api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; ?> |
123 | 123 | </option> |
124 | 124 | <?php |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | <?php |
135 | 135 | foreach ($db_urls as $url_obj) { |
136 | 136 | ?> |
137 | - <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) echo 'selected="selected"'; ?>> |
|
137 | + <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) echo 'selected="selected"'; ?>> |
|
138 | 138 | <?php echo $url_obj['url']; ?> |
139 | 139 | </option> |
140 | 140 | <?php |
@@ -189,8 +189,8 @@ |
||
189 | 189 | { |
190 | 190 | $code = CourseRequestManager::get_course_request_code($id); |
191 | 191 | $result = '<a href="course_request_edit.php?id='.$id.'&caller=0">'.Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align: middle;')).'</a>'. |
192 | - ' <a href="?accept_course_request='.$id.'">'.Display::return_icon('accept.png', get_lang('AcceptThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ANewCourseWillBeCreated'), $code), ENT_QUOTES)).'\')) return false;'),16).'</a>'. |
|
193 | - ' <a href="?reject_course_request='.$id.'">'.Display::return_icon('error.png', get_lang('RejectThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeRejected'), $code), ENT_QUOTES)).'\')) return false;'),16).'</a>'; |
|
192 | + ' <a href="?accept_course_request='.$id.'">'.Display::return_icon('accept.png', get_lang('AcceptThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ANewCourseWillBeCreated'), $code), ENT_QUOTES)).'\')) return false;'), 16).'</a>'. |
|
193 | + ' <a href="?reject_course_request='.$id.'">'.Display::return_icon('error.png', get_lang('RejectThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeRejected'), $code), ENT_QUOTES)).'\')) return false;'), 16).'</a>'; |
|
194 | 194 | if (!CourseRequestManager::additional_info_asked($id)) { |
195 | 195 | $result .= ' <a href="?request_info='.$id.'">'.Display::return_icon('request_info.gif', get_lang('AskAdditionalInfo'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('AdditionalInfoWillBeAsked'), $code), ENT_QUOTES)).'\')) return false;')).'</a>'; |
196 | 196 | } |
@@ -8,43 +8,43 @@ discard block |
||
8 | 8 | */ |
9 | 9 | exit(); //not yet functional, needs to be revised |
10 | 10 | |
11 | -$cidReset=true; |
|
11 | +$cidReset = true; |
|
12 | 12 | |
13 | 13 | require('../inc/global.inc.php'); |
14 | 14 | $libpath = api_get_path(LIBRARY_PATH); |
15 | 15 | require("../auth/ldap/authldap.php"); |
16 | -$annee_base=date('Y'); |
|
16 | +$annee_base = date('Y'); |
|
17 | 17 | // setting the section (for the tabs) |
18 | 18 | $this_section = SECTION_PLATFORM_ADMIN; |
19 | 19 | api_protect_admin_script(); |
20 | 20 | |
21 | 21 | // setting breadcrumbs |
22 | -$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
|
23 | -$interbreadcrumb[]=array('url' => api_get_self(),"name" => get_lang('SessionsList')); |
|
22 | +$interbreadcrumb[] = array('url' => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
23 | +$interbreadcrumb[] = array('url' => api_get_self(), "name" => get_lang('SessionsList')); |
|
24 | 24 | |
25 | 25 | // Database Table Definitions |
26 | 26 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
27 | -$tbl_session_rel_class = Database::get_main_table(TABLE_MAIN_SESSION_CLASS); |
|
28 | -$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
29 | -$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
|
30 | -$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
|
31 | -$tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
32 | -$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
|
33 | -$tbl_class = Database::get_main_table(TABLE_MAIN_CLASS); |
|
34 | -$tbl_class_user = Database::get_main_table(TABLE_MAIN_CLASS_USER); |
|
27 | +$tbl_session_rel_class = Database::get_main_table(TABLE_MAIN_SESSION_CLASS); |
|
28 | +$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
29 | +$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
|
30 | +$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
|
31 | +$tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
32 | +$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
|
33 | +$tbl_class = Database::get_main_table(TABLE_MAIN_CLASS); |
|
34 | +$tbl_class_user = Database::get_main_table(TABLE_MAIN_CLASS_USER); |
|
35 | 35 | |
36 | -$tbl_session_rel_etape = "session_rel_etape"; |
|
36 | +$tbl_session_rel_etape = "session_rel_etape"; |
|
37 | 37 | |
38 | -$id_session=intval($_GET['id_session']); |
|
38 | +$id_session = intval($_GET['id_session']); |
|
39 | 39 | |
40 | -$formSent=0; |
|
41 | -$errorMsg=$firstLetterUser=$firstLetterSession=''; |
|
42 | -$UserList=$SessionList=array(); |
|
43 | -$users=$sessions=array(); |
|
44 | -$noPHP_SELF=true; |
|
40 | +$formSent = 0; |
|
41 | +$errorMsg = $firstLetterUser = $firstLetterSession = ''; |
|
42 | +$UserList = $SessionList = array(); |
|
43 | +$users = $sessions = array(); |
|
44 | +$noPHP_SELF = true; |
|
45 | 45 | |
46 | -$page=intval($_GET['page']); |
|
47 | -$action=$_REQUEST['action']; |
|
46 | +$page = intval($_GET['page']); |
|
47 | +$action = $_REQUEST['action']; |
|
48 | 48 | |
49 | 49 | $tool_name = get_lang('Synchro LDAP : Import Etudiants/Etapes dans session'); |
50 | 50 | Display::display_header($tool_name); |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | </form> |
60 | 60 | |
61 | 61 | <?php |
62 | -if (isset($action) && ($action=="synchro")) { |
|
63 | - $included=true; |
|
62 | +if (isset($action) && ($action == "synchro")) { |
|
63 | + $included = true; |
|
64 | 64 | require('ldap_synchro.php'); |
65 | - Display :: display_normal_message($message,false); |
|
65 | + Display :: display_normal_message($message, false); |
|
66 | 66 | } |
67 | 67 | Display::display_footer(); |
68 | 68 | ?> |
@@ -13,8 +13,8 @@ |
||
13 | 13 | |
14 | 14 | $tool_name = get_lang('Export'); |
15 | 15 | |
16 | -$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
17 | -$interbreadcrumb[] = array ('url' => 'usergroups.php', 'name' => get_lang('Classes')); |
|
16 | +$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
17 | +$interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes')); |
|
18 | 18 | |
19 | 19 | set_time_limit(0); |
20 | 20 |
@@ -23,14 +23,14 @@ |
||
23 | 23 | |
24 | 24 | $interbreadcrumb = array( |
25 | 25 | array( |
26 | - 'url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php', |
|
26 | + 'url' => api_get_path(WEB_CODE_PATH).'admin/index.php', |
|
27 | 27 | 'name' => get_lang('Administration') |
28 | 28 | ) |
29 | 29 | ); |
30 | 30 | |
31 | 31 | $toolbar = Display::toolbarButton( |
32 | 32 | get_lang('ManageSkills'), |
33 | - api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php', |
|
33 | + api_get_path(WEB_CODE_PATH).'admin/skill_list.php', |
|
34 | 34 | 'list', |
35 | 35 | 'primary', |
36 | 36 | ['title' => get_lang('ManageSkills')] |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | */ |
32 | 32 | |
33 | -$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
33 | +$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
34 | 34 | $tool_name = get_lang('SearchLDAPUsers'); |
35 | 35 | //Display :: display_header($tool_name); //cannot display now as we need to redirect |
36 | 36 | //api_display_tool_title($tool_name); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | if (isset ($_GET['action'])) |
39 | 39 | { |
40 | 40 | $check = Security::check_token('get'); |
41 | - if($check) |
|
41 | + if ($check) |
|
42 | 42 | { |
43 | 43 | switch ($_GET['action']) |
44 | 44 | { |
@@ -59,41 +59,41 @@ discard block |
||
59 | 59 | break; |
60 | 60 | case 'lock' : |
61 | 61 | Display :: display_header($tool_name); |
62 | - $message=lock_unlock_user('lock',$_GET['user_id']); |
|
62 | + $message = lock_unlock_user('lock', $_GET['user_id']); |
|
63 | 63 | Display :: display_normal_message($message); |
64 | 64 | break; |
65 | 65 | case 'unlock'; |
66 | 66 | Display :: display_header($tool_name); |
67 | - $message=lock_unlock_user('unlock',$_GET['user_id']); |
|
67 | + $message = lock_unlock_user('unlock', $_GET['user_id']); |
|
68 | 68 | Display :: display_normal_message($message); |
69 | 69 | break; |
70 | 70 | case 'add_user'; |
71 | - $id=$_GET['id']; |
|
72 | - $UserList=array(); |
|
71 | + $id = $_GET['id']; |
|
72 | + $UserList = array(); |
|
73 | 73 | $userid_match_login = array(); |
74 | 74 | foreach ($id as $user_id) { |
75 | 75 | $tmp = ldap_add_user($user_id); |
76 | - $UserList[]= $tmp; |
|
76 | + $UserList[] = $tmp; |
|
77 | 77 | $userid_match_login[$tmp] = $user_id; |
78 | 78 | } |
79 | - if (isset($_GET['id_session']) && ($_GET['id_session'] == strval(intval($_GET['id_session']))) && ($_GET['id_session']>0)) { |
|
79 | + if (isset($_GET['id_session']) && ($_GET['id_session'] == strval(intval($_GET['id_session']))) && ($_GET['id_session'] > 0)) { |
|
80 | 80 | ldap_add_user_to_session($UserList, $_GET['id_session']); |
81 | 81 | header('Location: resume_session.php?id_session='.$_GET['id_session']); |
82 | 82 | } else { |
83 | 83 | Display :: display_header($tool_name); |
84 | - if(count($userid_match_login)>0) |
|
84 | + if (count($userid_match_login) > 0) |
|
85 | 85 | { |
86 | - $message=get_lang('LDAPUsersAddedOrUpdated').':<br />'; |
|
87 | - foreach($userid_match_login as $user_id => $login) |
|
86 | + $message = get_lang('LDAPUsersAddedOrUpdated').':<br />'; |
|
87 | + foreach ($userid_match_login as $user_id => $login) |
|
88 | 88 | { |
89 | 89 | $message .= '- '.$login.'<br />'; |
90 | 90 | } |
91 | 91 | } |
92 | 92 | else |
93 | 93 | { |
94 | - $message=get_lang('NoUserAdded'); |
|
94 | + $message = get_lang('NoUserAdded'); |
|
95 | 95 | } |
96 | - Display :: display_normal_message($message,false); |
|
96 | + Display :: display_normal_message($message, false); |
|
97 | 97 | } |
98 | 98 | break; |
99 | 99 | default : |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | if (isset ($_POST['action'])) |
114 | 114 | { |
115 | 115 | $check = Security::check_token('get'); |
116 | - if($check) |
|
116 | + if ($check) |
|
117 | 117 | { |
118 | 118 | switch ($_POST['action']) |
119 | 119 | { |
@@ -122,15 +122,15 @@ discard block |
||
122 | 122 | $number_of_deleted_users = 0; |
123 | 123 | foreach ($_POST['id'] as $index => $user_id) |
124 | 124 | { |
125 | - if($user_id != $_user['user_id']) |
|
125 | + if ($user_id != $_user['user_id']) |
|
126 | 126 | { |
127 | - if(UserManager :: delete_user($user_id)) |
|
127 | + if (UserManager :: delete_user($user_id)) |
|
128 | 128 | { |
129 | 129 | $number_of_deleted_users++; |
130 | 130 | } |
131 | 131 | } |
132 | 132 | } |
133 | - if($number_of_selected_users == $number_of_deleted_users) |
|
133 | + if ($number_of_selected_users == $number_of_deleted_users) |
|
134 | 134 | { |
135 | 135 | Display :: display_normal_message(get_lang('SelectedUsersDeleted')); |
136 | 136 | } |
@@ -142,17 +142,17 @@ discard block |
||
142 | 142 | case 'add_user' : |
143 | 143 | $number_of_selected_users = count($_POST['id']); |
144 | 144 | $number_of_added_users = 0; |
145 | - $UserList=array(); |
|
145 | + $UserList = array(); |
|
146 | 146 | foreach ($_POST['id'] as $index => $user_id) |
147 | 147 | { |
148 | - if($user_id != $_user['user_id']) |
|
148 | + if ($user_id != $_user['user_id']) |
|
149 | 149 | { |
150 | 150 | $UserList[] = ldap_add_user($user_id); |
151 | 151 | } |
152 | 152 | } |
153 | - if (isset($_GET['id_session']) && (trim($_GET['id_session'])!="")) |
|
153 | + if (isset($_GET['id_session']) && (trim($_GET['id_session']) != "")) |
|
154 | 154 | addUserToSession($UserList, $_GET['id_session']); |
155 | - if(count($UserList)>0) |
|
155 | + if (count($UserList) > 0) |
|
156 | 156 | { |
157 | 157 | Display :: display_normal_message(count($UserList)." ".get_lang('LDAPUsersAdded')); |
158 | 158 | } |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | } |
168 | 168 | } |
169 | 169 | |
170 | -$form = new FormValidator('advanced_search','get'); |
|
171 | -$form->addText('keyword_username',get_lang('LoginName'),false); |
|
170 | +$form = new FormValidator('advanced_search', 'get'); |
|
171 | +$form->addText('keyword_username', get_lang('LoginName'), false); |
|
172 | 172 | if (api_is_western_name_order()) |
173 | 173 | { |
174 | 174 | $form->addText('keyword_firstname', get_lang('FirstName'), false); |
@@ -176,20 +176,20 @@ discard block |
||
176 | 176 | } |
177 | 177 | else |
178 | 178 | { |
179 | - $form->addText('keyword_lastname',get_lang('LastName'),false); |
|
180 | - $form->addText('keyword_firstname',get_lang('FirstName'),false); |
|
179 | + $form->addText('keyword_lastname', get_lang('LastName'), false); |
|
180 | + $form->addText('keyword_firstname', get_lang('FirstName'), false); |
|
181 | 181 | } |
182 | 182 | if (isset($_GET['id_session'])) |
183 | - $form->addElement('hidden','id_session',$_GET['id_session']); |
|
183 | + $form->addElement('hidden', 'id_session', $_GET['id_session']); |
|
184 | 184 | |
185 | 185 | $type = array(); |
186 | 186 | $type["all"] = get_lang('All'); |
187 | -$type["employee"] = get_lang('Teacher'); |
|
187 | +$type["employee"] = get_lang('Teacher'); |
|
188 | 188 | $type["student"] = get_lang('Student'); |
189 | 189 | |
190 | -$form->addElement('select','keyword_type',get_lang('Status'),$type); |
|
190 | +$form->addElement('select', 'keyword_type', get_lang('Status'), $type); |
|
191 | 191 | // Structure a rajouer ?? |
192 | -$form->addElement('submit','submit',get_lang('Ok')); |
|
192 | +$form->addElement('submit', 'submit', get_lang('Ok')); |
|
193 | 193 | //$defaults['keyword_active'] = 1; |
194 | 194 | //$defaults['keyword_inactive'] = 1; |
195 | 195 | //$form->setDefaults($defaults); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | //$table->set_column_filter(5, 'email_filter'); |
226 | 226 | //$table->set_column_filter(5, 'active_filter'); |
227 | 227 | $table->set_column_filter(5, 'modify_filter'); |
228 | -$table->set_form_actions(array ('add_user' => get_lang('AddLDAPUsers'))); |
|
228 | +$table->set_form_actions(array('add_user' => get_lang('AddLDAPUsers'))); |
|
229 | 229 | $table->display(); |
230 | 230 | |
231 | 231 | /* |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $htmlHeadXtra[] = api_get_jqgrid_js(); |
19 | 19 | |
20 | 20 | // setting breadcrumbs |
21 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
21 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
22 | 22 | |
23 | 23 | $tool_name = null; |
24 | 24 | |
@@ -39,23 +39,23 @@ discard block |
||
39 | 39 | $token = Security::get_token(); |
40 | 40 | |
41 | 41 | if ($action == 'add') { |
42 | - $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type,'name' => $extra_field->pageName); |
|
43 | - $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'],'name' => $extra_field_info['display_text']); |
|
44 | - $interbreadcrumb[]=array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions')); |
|
45 | - $interbreadcrumb[]=array('url' => '#','name' => get_lang('Add')); |
|
42 | + $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName); |
|
43 | + $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'], 'name' => $extra_field_info['display_text']); |
|
44 | + $interbreadcrumb[] = array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions')); |
|
45 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add')); |
|
46 | 46 | } elseif ($action == 'edit') { |
47 | - $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type,'name' => $extra_field->pageName); |
|
48 | - $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'],'name' => $extra_field_info['display_text']); |
|
49 | - $interbreadcrumb[]=array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions')); |
|
47 | + $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName); |
|
48 | + $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'], 'name' => $extra_field_info['display_text']); |
|
49 | + $interbreadcrumb[] = array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions')); |
|
50 | 50 | |
51 | - $interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit')); |
|
51 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit')); |
|
52 | 52 | } else { |
53 | - $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type,'name' => $extra_field->pageName); |
|
54 | - $interbreadcrumb[]=array( |
|
53 | + $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName); |
|
54 | + $interbreadcrumb[] = array( |
|
55 | 55 | 'url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'], |
56 | 56 | 'name' => $extra_field_info['display_text'] |
57 | 57 | ); |
58 | - $interbreadcrumb[]=array('url' => '#','name' => get_lang('EditExtraFieldOptions')); |
|
58 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditExtraFieldOptions')); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | //jqgrid will use this URL to do the selects |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | |
109 | 109 | //With this function we can add actions to the jgrid (edit, delete, etc) |
110 | 110 | $action_links = 'function action_formatter(cellvalue, options, rowObject) { |
111 | - return \'<a href="?action=edit&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'. |
|
112 | - ' <a onclick="javascript:if(!confirm('."\'".addslashes(get_lang("ConfirmYourChoice"))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'. |
|
111 | + return \'<a href="?action=edit&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'. |
|
112 | + ' <a onclick="javascript:if(!confirm('."\'".addslashes(get_lang("ConfirmYourChoice"))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'. |
|
113 | 113 | '\'; |
114 | 114 | }'; |
115 | 115 | |
116 | -$htmlHeadXtra[]='<script> |
|
116 | +$htmlHeadXtra[] = '<script> |
|
117 | 117 | $(function() { |
118 | 118 | // grid definition see the $obj->display() function |
119 | 119 | '.Display::grid_js( |