예제 #1
0
 /**
  * Return (or create, assuming no external auth backend) a user based on
  * a provided openid identity
  * 
  * @param string $identity
  * 
  * @return TBGUser 
  */
 public static function getByOpenID($identity)
 {
     $user = null;
     if ($user_id = TBGOpenIdAccountsTable::getTable()->getUserIDfromIdentity($identity)) {
         $user = TBGContext::factory()->TBGUser($user_id);
     } elseif (!TBGSettings::isUsingExternalAuthenticationBackend() && TBGSettings::getOpenIDStatus() == 'all') {
         $user = new TBGUser();
         $user->setPassword(TBGUser::createPassword());
         $user->setUsername(TBGUser::createPassword() . TBGUser::createPassword());
         $user->setOpenIdLocked();
         $user->setActivated();
         $user->setEnabled();
         $user->setValidated();
         $user->save();
     }
     return $user;
 }
예제 #2
0
><?php 
    echo __('Users can register with OpenID and link OpenID to existing accounts');
    ?>
</option>
					<option value="existing"<?php 
    if (TBGSettings::getOpenIDStatus() == 'existing') {
        ?>
 selected<?php 
    }
    ?>
><?php 
    echo __('Users can only link OpenID logins with existing accounts');
    ?>
</option>
					<option value="none"<?php 
    if (TBGSettings::getOpenIDStatus() == 'none') {
        ?>
 selected<?php 
    }
    ?>
><?php 
    echo __('OpenID authentication is disabled');
    ?>
</option>
				</select>
			<?php 
} else {
    ?>
				<div class="faded_out"><?php 
    echo __('OpenID support is not available when not using internal authentication');
    ?>