Merge branch 'master' of ssh://git.fedorahosted.org/git/fedora-infrastructure
This commit is contained in:
commit
8414db7214
3 changed files with 90 additions and 4 deletions
|
@ -6,6 +6,24 @@ TEXT HELP
|
|||
Install currently supported Fedora releases
|
||||
ENDTEXT
|
||||
|
||||
label Fedora-19-x86_64
|
||||
MENU LABEL Fedora-19-x86_64
|
||||
kernel http://download.fedoraproject.org/pub/fedora/linux/releases/19/Fedora/x86_64/os/images/pxeboot/vmlinuz
|
||||
initrd http://download.fedoraproject.org/pub/fedora/linux/releases/19/Fedora/x86_64/os/images/pxeboot/initrd.img
|
||||
APPEND repo=http://download.fedoraproject.org/pub/fedora/linux/releases/19/Fedora/x86_64/os/
|
||||
TEXT HELP
|
||||
Selecting this will boot the Fedora 19 x86_64 installer.
|
||||
ENDTEXT
|
||||
|
||||
label Fedora-19-i386
|
||||
MENU LABEL Fedora-19-i386
|
||||
kernel http://download.fedoraproject.org/pub/fedora/linux/releases/19/Fedora/i386/os/images/pxeboot/vmlinuz
|
||||
initrd http://download.fedoraproject.org/pub/fedora/linux/releases/19/Fedora/i386/os/images/pxeboot/initrd.img
|
||||
APPEND repo=http://download.fedoraproject.org/pub/fedora/linux/releases/19/Fedora/i386/os/
|
||||
TEXT HELP
|
||||
Selecting this will boot the Fedora 19 i386 installer.
|
||||
ENDTEXT
|
||||
|
||||
label Fedora-18-x86_64
|
||||
MENU LABEL Fedora-18-x86_64
|
||||
kernel http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/x86_64/os/images/pxeboot/vmlinuz
|
||||
|
|
|
@ -7,6 +7,24 @@ TEXT HELP
|
|||
Rescue currently supported versions of Fedora
|
||||
ENDTEXT
|
||||
|
||||
label Fedora-19-i386-rescue
|
||||
MENU LABEL Fedora-19-i386-rescue
|
||||
kernel http://download.fedoraproject.org/pub/fedora/linux/releases/19/Fedora/i386/os/images/pxeboot/vmlinuz
|
||||
initrd http://download.fedoraproject.org/pub/fedora/linux/releases/19/Fedora/i386/os/images/pxeboot/initrd.img
|
||||
APPEND rescue
|
||||
TEXT HELP
|
||||
Selecting this will boot the Fedora 19 i386 installer in rescue mode
|
||||
ENDTEXT
|
||||
|
||||
label Fedora-19-x86_64-rescue
|
||||
MENU LABEL Fedora-19-x86_64-rescue
|
||||
kernel http://download.fedoraproject.org/pub/fedora/linux/releases/19/Fedora/x86_64/os/images/pxeboot/vmlinuz
|
||||
initrd http://download.fedoraproject.org/pub/fedora/linux/releases/19/Fedora/x86_64/os/images/pxeboot/initrd.img
|
||||
APPEND rescue
|
||||
TEXT HELP
|
||||
Selecting this will boot the Fedora 19 x86_64 installer in rescue mode.
|
||||
ENDTEXT
|
||||
|
||||
label Fedora-18-i386-rescue
|
||||
MENU LABEL Fedora-18-i386-rescue
|
||||
kernel http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/i386/os/images/pxeboot/vmlinuz
|
||||
|
|
|
@ -1,12 +1,24 @@
|
|||
<?php
|
||||
require_once('AuthPlugin.php');
|
||||
class Auth_FAS extends AuthPlugin {
|
||||
function authenticate($username, $password) {
|
||||
|
||||
var $fas_username;
|
||||
|
||||
function setFasUsername($user) {
|
||||
$this->fas_username = $user;
|
||||
}
|
||||
|
||||
function getFasUsername() {
|
||||
return $this->fas_username;
|
||||
}
|
||||
|
||||
function authenticate(&$username, $password) {
|
||||
|
||||
if ( ucfirst(strtolower($username)) != ucfirst($username) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$username = strtolower( $username);
|
||||
$username = strtolower($username);
|
||||
$ch = curl_init();
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, 'https://admin.fedoraproject.org/accounts/home');
|
||||
|
@ -35,6 +47,9 @@ class Auth_FAS extends AuthPlugin {
|
|||
}
|
||||
|
||||
$groups = $response['memberships'];
|
||||
// let's make sure the username is consistent
|
||||
$this->setFasUsername(ucfirst(strtolower($response['person']['username'])));
|
||||
$username = $this->getFasUsername();
|
||||
|
||||
for ($i = 0, $cnt = count($groups); $i < $cnt; $i++) {
|
||||
if ($groups[$i]["name"] == 'cla_done' && $response['person']['status'] == 'active') {
|
||||
|
@ -47,68 +62,103 @@ class Auth_FAS extends AuthPlugin {
|
|||
}
|
||||
|
||||
function userExists( $username ) {
|
||||
if ( ucfirst(strtolower($username)) != ucfirst($username) ) {
|
||||
error_log("FAS [userExists]: $username, " . $this->getFasUsername(), 0);
|
||||
|
||||
if (ucfirst(strtolower($username)) != $this->getFasUsername()) {
|
||||
error_log("FAS [userExists]: returned false", 0);
|
||||
return false;
|
||||
}
|
||||
error_log("FAS [userExists]: returned true", 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
function modifyUITemplate(&$template) {
|
||||
error_log("FAS [modifyUITemplate]: " . $this->getFasUsername(), 0);
|
||||
$template->set('create', false);
|
||||
$template->set('useemail', false);
|
||||
$template->set('usedomain', false);
|
||||
}
|
||||
|
||||
function updateUser( &$user ){
|
||||
//error_log("FAS [updateUser]: " . $user->getName() . ", " . $this->getFasUsername(), 0);
|
||||
$user->setName($this->getFasUsername());
|
||||
$user->mEmail = strtolower($user->getName())."@fedoraproject.org";
|
||||
//error_log("FAS [updateUser]: " . $user->getName() . ", " . $this->getFasUsername(), 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
function autoCreate() {
|
||||
//error_log("FAS [autoCreate]: ", 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
function setPassword($password) {
|
||||
//error_log("FAS [setPassword]: $password", 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
function setDomain( $domain ) {
|
||||
//error_log("FAS [setDomain]: $domain", 0);
|
||||
$this->domain = $domain;
|
||||
}
|
||||
|
||||
function validDomain( $domain ) {
|
||||
//error_log("FAS [validDomain]: $domain", 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
function updateExternalDB($user) {
|
||||
//error_log("FAS [updateExternalDB]: $user", 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
function canCreateAccounts() {
|
||||
//error_log("FAS [canCreateAccounts]:", 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
function addUser($user, $password) {
|
||||
//error_log("FAS [addUser]: $user, $password", 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
function strict() {
|
||||
//error_log("FAS [strict]:", 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
function strictUserAuth( $username ) {
|
||||
//error_log("FAS [strictUserAuth]: $username", 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
function allowPasswordChange() {
|
||||
//error_log("FAS [allowPasswordChange]:" . $this->getFasUsername(), 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
function getCanonicalName( $username ) {
|
||||
//error_log("FAS [getCanonicalName]: " . $username, 0);
|
||||
|
||||
$username = str_replace('@fedoraproject.org', '', $username);
|
||||
|
||||
//error_log("FAS [getCanonicalName]: returning... " . $username, 0);
|
||||
return $username;
|
||||
}
|
||||
|
||||
function getUserInstance( &$user ) {
|
||||
//error_log("FAS [getUserInstance]: " . print_r($user), 0);
|
||||
return new AuthPluginUser( $user );
|
||||
}
|
||||
|
||||
function initUser(&$user) {
|
||||
//error_log("FAS [initUser]: " . $user->getName() . ", " . $this->getFasUsername(), 0);
|
||||
$user->setName($this->getFasUsername());
|
||||
$user->mEmail = strtolower($user->getName())."@fedoraproject.org";
|
||||
$user->mEmailAuthenticated = wfTimestampNow();
|
||||
$user->setToken();
|
||||
$user->saveSettings();
|
||||
//error_log("FAS [initUser]: " . $user->getName() . ", " . $this->getFasUsername(), 0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue