Created
March 11, 2013 22:14
-
-
Save mbrooks/5138368 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Import Drupal Users to Drupal SAML Users | |
* Works with the SimpleSAMLphp Auth Drupal Module | |
* By: Matt Brooks | |
* Email: [email protected] | |
*/ | |
function import_saml_users(){ | |
$result = db_query("SELECT * FROM {users}"); | |
foreach( | |
$result as $record ) { | |
$nid = db_insert('authmap') | |
->fields(array( | |
'uid' => $record->uid, | |
'authname' => $record->name, | |
'module' => 'simplesamlphp_auth' | |
)) | |
->execute(); | |
} | |
return | |
'finish import SAML users!'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment