mlanthaler: ... forgot to remove debug code :-) (merged from branches/gsoc)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41912 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-15 20:00:24 +00:00
parent d6ddbf2cff
commit f2dc279789

View File

@ -16,46 +16,7 @@
*
* @author Markus Lanthaler <markus@silverstripe.com
*/
class OpenIDAuthenticatedRole extends DataObjectDecorator{
/**
* Edit the given query object to support queries for this extension
*/
function augmentSQL(SQLQuery &$query) {
}
/**
* Update the database schema as required by this extension
*/
function augmentDatabase() {
/* if(Permission::check('ADMIN')) {
$exist = DB::query( "SHOW TABLES LIKE 'ForumMember'" )->numRecords();
if($exist > 0) {
DB::query( "UPDATE `Member`, `ForumMember` " .
"SET `Member`.`ClassName` = 'Member'," . "`Member`.`ForumRank` =
`ForumMember`.`ForumRank`," . "`Member`.`Occupation` =
`ForumMember`.`Occupation`," . "`Member`.`Country` =
`ForumMember`.`Country`," . "`Member`.`Nickname` =
`ForumMember`.`Nickname`," . "`Member`.`FirstNamePublic` =
`ForumMember`.`FirstNamePublic`," . "`Member`.`SurnamePublic` =
`ForumMember`.`SurnamePublic`," . "`Member`.`OccupationPublic` =
`ForumMember`.`OccupationPublic`," . "`Member`.`CountryPublic` =
`ForumMember`.`CountryPublic`," . "`Member`.`EmailPublic` =
`ForumMember`.`EmailPublic`," . "`Member`.`AvatarID` =
`ForumMember`.`AvatarID`," . "`Member`.`LastViewed` =
`ForumMember`.`LastViewed`" . "WHERE `Member`.`ID` =
`ForumMember`.`ID`"
);
echo( "<div style=\"padding:5px; color:white;
background-color:blue;\">The data transfer has succeeded. However,
to complete it, you must delete the ForumMember table. To do this,
execute the query \"DROP TABLE 'ForumMember'\".</div>" );
}
}*/
}
class OpenIDAuthenticatedRole extends DataObjectDecorator {
/**
* Define extra database fields
@ -76,6 +37,26 @@ class OpenIDAuthenticatedRole extends DataObjectDecorator{
}
/**
* Edit the given query object to support queries for this extension
*
* At the moment this method does nothing.
*
* @param SQLQuery $query Query to augment.
*/
function augmentSQL(SQLQuery &$query) {
}
/**
* Update the database schema as required by this extension
*
* At the moment this method does nothing.
*/
function augmentDatabase() {
}
/**
* Change the member dialog in the CMS
*
@ -83,29 +64,16 @@ class OpenIDAuthenticatedRole extends DataObjectDecorator{
* to edit the new database fields.
*/
function updateCMSFields(FieldSet &$fields) {
//if(Permission::checkMember($this->owner->ID, "ACCESS_FORUM")) {
$fields->push(new HeaderField("OpenID/i-name credentials"), "OpenIDHeader");
$fields->push(new LiteralField("OpenIDDescription",
"<p>Make sure you enter your normalized OpenID/i-name credentials here, i.e. with protocol and trailing slash for OpenID (e.g. http://openid.silverstripe.com/).</p>"));
$fields->push(new TextField("IdentityURL", "OpenID URL/i-name"), "IdentityURL");
/*
$fields->push(new PasswordField("ConfirmPassword", "Confirm Password"));
$fields->push(new ImageField("Avatar", "Upload avatar"));
$fields->push(new DropdownField("ForumRank", "User rating",
array("Community Member" => "Community Member",
"Administrator" => "Administrator",
"Moderator" => "Moderator",
"SilverStripe User" => "SilverStripe User",
"SilverStripe Developer" => "SilverStripe Developer",
"Core Development Team" => "Core Development Team",
"Google Summer of Code Hacker" => "Google Summer of Code Hacker",
"Lead Developer" => "Lead Developer")
)
);
}*/
$fields->push(new HeaderField("OpenID/i-name credentials"), "OpenIDHeader");
$fields->push(new LiteralField("OpenIDDescription",
"<p>Make sure you enter your normalized OpenID/i-name credentials " .
"here, i.e. with protocol and trailing slash for OpenID (e.g. " .
"http://openid.silverstripe.com/).</p>"));
$fields->push(new TextField("IdentityURL", "OpenID URL/i-name"),
"IdentityURL");
}
/**
* Can the current user edit the given member?
*
@ -123,20 +91,6 @@ class OpenIDAuthenticatedRole extends DataObjectDecorator{
return false;
}
/**
* Factory method for the member validator
*
* @return Member_Validator Returns an instance of a
* {@link Member_Validator} object.
*/
function getValidator() {
die('<p style="color: red;">Called getValidator()</p>');
return new Member_Validator();
}
}