Révision 38c269d5
Ajouté par Assos Assos il y a plus de 6 ans
drupal7/sites/all/modules/cas/cas.install | ||
---|---|---|
27 | 27 |
'unsigned' => TRUE, |
28 | 28 |
'not null' => TRUE, |
29 | 29 |
), |
30 |
'created' => array( |
|
31 |
'type' => 'int', |
|
32 |
'not null' => TRUE, |
|
33 |
'default' => 0, |
|
34 |
'description' => 'Timestamp when this record was created.', |
|
35 |
), |
|
30 | 36 |
), |
31 | 37 |
'primary key' => array('cas_session_id'), |
32 | 38 |
); |
... | ... | |
107 | 113 |
variable_del('cas_uri'); |
108 | 114 |
variable_del('cas_user_register'); |
109 | 115 |
variable_del('cas_version'); |
116 |
variable_del('cas_single_logout_session_lifetime'); |
|
110 | 117 |
|
111 | 118 |
// And old (un-used) variables. |
112 | 119 |
variable_del('cas_cert_verify'); |
... | ... | |
144 | 151 |
$requirements['phpcas']['severity'] = REQUIREMENT_ERROR; |
145 | 152 |
$requirements['phpcas']['description'] = $t('phpCAS could not be loaded. Please <a href="@phpcas_url">download phpCAS</a> and <a href="@cas_url">configure its location</a>.', array('@phpcas_url' => $phpcas_url, '@cas_url' => url('admin/config/people/cas'))); |
146 | 153 |
} |
154 |
|
|
155 |
$cert = variable_get('cas_cert'); |
|
156 |
if (empty($cert)) { |
|
157 |
$requirements['cas_cert'] = array( |
|
158 |
'title' => $t('CAS SSL certificate bundle'), |
|
159 |
'severity' => REQUIREMENT_ERROR, |
|
160 |
'value' => $t('Not set'), |
|
161 |
'description' => $t('The CAS authentication process is not completely secure. Please <a href="@settings_url">visit the CAS settings page</a> and provide the path to the certificate authority bundle.'), |
|
162 |
); |
|
163 |
} |
|
147 | 164 |
} |
148 | 165 |
return $requirements; |
149 | 166 |
} |
150 | 167 |
|
168 |
/** |
|
169 |
* Implements hook_enable(). |
|
170 |
*/ |
|
171 |
function cas_enable() { |
|
172 |
drupal_set_message(t('CAS has been enabled. Please <a href="@url">configure</a> it.', array('@url' => url('admin/config/people/cas'))), 'warning'); |
|
173 |
} |
|
174 |
|
|
151 | 175 |
/** |
152 | 176 |
* Creates CAS login data table for Single-Sign-Out. |
153 | 177 |
*/ |
... | ... | |
381 | 405 |
db_add_index('cas_user', 'cas_user', array('uid')); |
382 | 406 |
} |
383 | 407 |
} |
408 |
|
|
409 |
/** |
|
410 |
* Add created column to cas_login_data table. |
|
411 |
*/ |
|
412 |
function cas_update_7103() { |
|
413 |
db_add_field('cas_login_data', 'created', array( |
|
414 |
'type' => 'int', |
|
415 |
'not null' => TRUE, |
|
416 |
'default' => 0, |
|
417 |
'description' => 'Timestamp when this record was created.', |
|
418 |
)); |
|
419 |
$now = time(); |
|
420 |
// Assume that all data was inserted today. This is obviously not true, but |
|
421 |
// it will prevent us from deleting the existing data for some time, since |
|
422 |
// the cron task will only delete data older than X days. |
|
423 |
db_update('cas_login_data') |
|
424 |
->fields(array('created' => $now)) |
|
425 |
->execute(); |
|
426 |
} |
|
427 |
|
|
428 |
/** |
|
429 |
* Hash all existing CAS session IDs in cas_login_data. |
|
430 |
*/ |
|
431 |
function cas_update_7104() { |
|
432 |
$result = db_query('SELECT cas_session_id FROM {cas_login_data}'); |
|
433 |
foreach ($result as $data) { |
|
434 |
db_update('cas_login_data') |
|
435 |
->fields(array('cas_session_id' => hash('sha256', $data->cas_session_id))) |
|
436 |
->condition('cas_session_id', $data->cas_session_id) |
|
437 |
->execute(); |
|
438 |
} |
|
439 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules