import v1.0.0-RC4 | 2009-05-20

This commit is contained in:
6543 2019-07-17 22:08:50 +02:00
commit b484e522e8
2459 changed files with 1038434 additions and 0 deletions

111
Acl.php Executable file
View File

@ -0,0 +1,111 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/


self::$acl->addRole(new Zend_Acl_Role(User::ROLE_GUEST))
->addRole(new Zend_Acl_Role(User::ROLE_REGISTERED), User::ROLE_GUEST)
->addRole(new Zend_Acl_Role(User::ROLE_ADMIN), User::ROLE_REGISTERED);

/**************************
* ACTION CONTROLLER PRIVILEGES
*
* format: $privileges[module][controller][action] = role;
**************************/
$privileges['default']['index']['index'] = User::ROLE_GUEST;
$privileges['default']['identity']['index'] = User::ROLE_GUEST;
$privileges['default']['identity']['id'] = User::ROLE_GUEST;

$privileges['default']['error']['error'] = User::ROLE_GUEST;

$privileges['default']['openid']['provider'] = User::ROLE_GUEST;
$privileges['default']['openid']['login'] = User::ROLE_GUEST;
$privileges['default']['openid']['authenticate'] = User::ROLE_GUEST;
$privileges['default']['openid']['trust'] = User::ROLE_GUEST;

$privileges['default']['sites']['index'] = User::ROLE_REGISTERED;
$privileges['default']['sites']['list'] = User::ROLE_REGISTERED;
$privileges['default']['sites']['deny'] = User::ROLE_REGISTERED;
$privileges['default']['sites']['allow'] = User::ROLE_REGISTERED;
$privileges['default']['sites']['delete'] = User::ROLE_REGISTERED;

$privileges['default']['history']['index'] = User::ROLE_REGISTERED;
$privileges['default']['history']['list'] = User::ROLE_REGISTERED;
$privileges['default']['history']['clear'] = User::ROLE_REGISTERED;

$privileges['default']['messageusers']['index'] = User::ROLE_ADMIN;
$privileges['default']['messageusers']['send'] = User::ROLE_ADMIN;

$privileges['default']['maintenancemode']['enable'] = User::ROLE_ADMIN;
$privileges['default']['maintenancemode']['disable'] = User::ROLE_ADMIN;

$privileges['default']['feedback']['index'] = User::ROLE_GUEST;
$privileges['default']['feedback']['send'] = User::ROLE_GUEST;

$privileges['default']['privacy']['index'] = User::ROLE_GUEST;

$privileges['default']['about']['index'] = User::ROLE_GUEST;

$privileges['default']['learnmore']['index'] = User::ROLE_GUEST;

$privileges['install']['index']['index'] = User::ROLE_GUEST;
$privileges['install']['permissions']['index'] = User::ROLE_GUEST;
$privileges['install']['credentials']['index'] = User::ROLE_GUEST;
$privileges['install']['credentials']['save'] = User::ROLE_GUEST;
$privileges['install']['complete']['index'] = User::ROLE_GUEST;

$privileges['users']['login']['index'] = User::ROLE_GUEST;
$privileges['users']['login']['logout'] = User::ROLE_GUEST;
$privileges['users']['login']['authenticate'] = User::ROLE_GUEST;

$privileges['users']['userlist']['index'] = User::ROLE_ADMIN;

$privileges['users']['register']['index'] = User::ROLE_GUEST;
$privileges['users']['register']['save'] = User::ROLE_GUEST;
$privileges['users']['register']['eula'] = User::ROLE_GUEST;
$privileges['users']['register']['declineeula'] = User::ROLE_GUEST;
$privileges['users']['register']['accepteula'] = User::ROLE_GUEST;

$privileges['users']['profile']['index'] = User::ROLE_REGISTERED;
$privileges['users']['profile']['edit'] = User::ROLE_REGISTERED;
$privileges['users']['profile']['save'] = User::ROLE_REGISTERED;

$privileges['users']['personalinfo']['index'] = User::ROLE_REGISTERED;
$privileges['users']['personalinfo']['show'] = User::ROLE_REGISTERED;
$privileges['users']['personalinfo']['edit'] = User::ROLE_REGISTERED;
$privileges['users']['personalinfo']['save'] = User::ROLE_REGISTERED;

$privileges['users']['profilegeneral']['accountinfo'] = User::ROLE_REGISTERED;
$privileges['users']['profilegeneral']['editaccountinfo'] = User::ROLE_REGISTERED;
$privileges['users']['profilegeneral']['saveaccountinfo'] = User::ROLE_REGISTERED;
$privileges['users']['profilegeneral']['changepassword'] = User::ROLE_REGISTERED;
$privileges['users']['profilegeneral']['savepassword'] = User::ROLE_REGISTERED;
$privileges['users']['profilegeneral']['confirmdelete'] = User::ROLE_REGISTERED;
$privileges['users']['profilegeneral']['delete'] = User::ROLE_REGISTERED;

$privileges['users']['recoverpassword']['index'] = User::ROLE_GUEST;
$privileges['users']['recoverpassword']['send'] = User::ROLE_GUEST;
$privileges['users']['recoverpassword']['reset'] = User::ROLE_GUEST;

$privileges['users']['manageusers']['index'] = User::ROLE_ADMIN;
$privileges['users']['manageusers']['delete'] = User::ROLE_ADMIN;
$privileges['users']['manageusers']['deleteunconfirmed'] = User::ROLE_ADMIN;

$privileges['users']['userslist']['index'] = User::ROLE_ADMIN;

$privileges['stats']['index']['index'] = User::ROLE_ADMIN;
$privileges['stats']['registrations']['index'] = User::ROLE_ADMIN;
$privileges['stats']['registrations']['graph'] = User::ROLE_ADMIN;
$privileges['stats']['authorizations']['index'] = User::ROLE_ADMIN;
$privileges['stats']['authorizations']['graph'] = User::ROLE_ADMIN;
$privileges['stats']['sites']['index'] = User::ROLE_ADMIN;
$privileges['stats']['sites']['graph'] = User::ROLE_ADMIN;
$privileges['stats']['top']['index'] = User::ROLE_ADMIN;
$privileges['stats']['top']['graph'] = User::ROLE_ADMIN;

0
BUGS Normal file
View File

16
CHANGELOG Normal file
View File

@ -0,0 +1,16 @@
2009-04-21 Reiner Jung <reiner@kb-m.com>

New features:
- Added configuration directives to support OpenID URLs using subdomains.
- Add a configuration directives to set the number of news items to show.
- When in maintenance mode, have a warning message explaining, and disable the login section.
- Improved installation procedure.
- Improved error handling and logging.
- Return 404 and 401 status on page not found and access denied scenarios, respectively.
- Don't send email on Access Denied Exceptions, as these may be caused by session timeouts.
- Check if set_include_path() is supported by the current PHP configuration.
- Moved from PDO Mysql to MySQLi database back-end, to avoid problems under Windows servers.

Bug fixes:
- Was throwing an exception when logging in during an openid authentication.
- Wasn't showing 'denied' or 'authorized' in the history list

19
CONTRIBUTORS Normal file
View File

@ -0,0 +1,19 @@
Contributors to Community-ID development

Main developers

* Keyboard Monkeys Ltd.

Patch contribution

* Florian Eibeck (C-ID 1.0.0 RC3)

Translations

* Polish Translation from Piotr Baranowski
* Dutch Translation from Stanley Westerveld

Testing



5
INSTALL Normal file
View File

@ -0,0 +1,5 @@
This is the initial Install file for Community-ID. We will work on this file soon.

For more information how to install Community-ID please have a look at the projekt wiki:

http://source.keyboard-monkeys.org/wiki/communityid/How_to_install_Community-ID_under_Linux

1
README Normal file
View File

@ -0,0 +1 @@
import things form https://sourceforge.net/projects/communityid/files/

261
Setup.php Executable file
View File

@ -0,0 +1,261 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

class Setup
{
const VERSION = '1.0.0_RC2';

public static $config;
public static $logger;
public static $mockLogger;
public static $acl;
public static $front;

/**
* Used in unit tests
*/
public static function cleanUp()
{
Zend_Registry::_unsetInstance();
Zend_Layout::resetMvcInstance();
Zend_Controller_Action_HelperBroker::resetHelpers();
}

public static function setIncludePath()
{
$pathList = array(
get_include_path(),
APP_DIR,
APP_DIR.'/libs',
APP_DIR.'/modules/default/models',
APP_DIR.'/modules/default/forms',
APP_DIR.'/modules/users/models',
APP_DIR.'/modules/users/forms',
APP_DIR.'/modules/stats/models',
APP_DIR.'/modules/install/forms',
);
if (!set_include_path(implode(PATH_SEPARATOR, $pathList))) {
die('ERROR: couldn\'t execute PHP\'s set_include_path() function in your system.'
.' Please ask your system admin to enable that functionality.');
}
}

public static function setAutoLoader()
{
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
}

public static function setConfig()
{
if (file_exists(APP_DIR . DIRECTORY_SEPARATOR . 'config.php')) {
$configFile = APP_DIR . DIRECTORY_SEPARATOR . 'config.php';
} else {
$configFile = APP_DIR . DIRECTORY_SEPARATOR . 'config.default.php';
}

$config = array();
require $configFile;
self::$config = new Zend_Config($config, array('allowModifications' => true));
if(self::$config->environment->installed === null) {
$configFile = APP_DIR . DIRECTORY_SEPARATOR . 'config.default.php';
require $configFile;
self::$config = new Zend_Config($config, array('allowModifications' => true));
}

// @todo: remove this when all interconnected apps use the same LDAP source
self::$config->environment->app = 'communityid';

Zend_Registry::set('config', self::$config);
}

public static function setErrorReporting()
{
ini_set('log_errors', 'Off');
if (self::$config->environment->production) {
error_reporting(E_ALL & E_NOTICE);
ini_set('display_errors', 'Off');
} else {
error_reporting(E_ALL);
ini_set('display_errors', 'On');
}
}

public static function setLogger($addMockWriter = false)
{
self::$logger = new Zend_Log();
if (self::$config->logging->level == 0) {
self::$logger->addWriter(new Zend_Log_Writer_Null(APP_DIR . '/log.txt'));
} else {
if (is_writable(self::$config->logging->location)) {
$file = self::$config->logging->location;
} else if (!is_writable(APP_DIR . DIRECTORY_SEPARATOR . self::$config->logging->location)) {
throw new Exception('Couldn\'t find log file, or maybe it\'s not writable');
} else {
$file = APP_DIR . DIRECTORY_SEPARATOR . self::$config->logging->location;
}

self::$logger->addWriter(new Zend_Log_Writer_Stream($file));
if ($addMockWriter) {
self::$mockLogger = new Zend_Log_Writer_Mock();
self::$logger->addWriter(self::$mockLogger);
}
}
self::$logger->addFilter(new Zend_Log_Filter_Priority((int)self::$config->logging->level));
Zend_Registry::set('logger', self::$logger);
}

public static function logRequest()
{
if (isset($_SERVER['REQUEST_URI'])) {
self::$logger->log('REQUESTED URI: ' . $_SERVER['REQUEST_URI'], Zend_Log::INFO);
} else {
self::$logger->log('REQUESTED THROUGH CLI: ' . $GLOBALS['argv'][0], Zend_Log::INFO);
}

if (isset($_POST) && $_POST) {
self::$logger->log('POST payload: ' . print_r($_POST, 1), Zend_Log::INFO);
}
}

public static function setDatabase()
{
self::$config->database->params->driver_options = array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true);
$db = Zend_Db::factory(self::$config->database);
if (self::$config->logging->level == Zend_Log::DEBUG) {
$profiler = new Monkeys_Db_Profiler();
$db->setProfiler($profiler);
}
Zend_Db_Table_Abstract::setDefaultAdapter($db);
Zend_Registry::set('db', $db);

try {
$db->getConnection();
return true;
} catch (Zend_Db_Adapter_Exception $e) {
return false;
}
}

public static function setSession()
{
// The framework doesn't provide yet a clean way of doing this
if (isset($_POST['rememberme'])) {
Zend_Session::rememberMe();
}

// ZF still doesn't have facilities for session_name().
session_name(self::$config->environment->session_name);

$appSession = new Zend_Session_Namespace('Default');
if (is_null($appSession->messages)) {
$appSession->messages = array();
}
Zend_Registry::set('appSession', $appSession);
}

public static function setAcl()
{
self::$acl = new Zend_Acl();
require 'Acl.php';

foreach ($privileges as $module => $moduleConfig) {
foreach ($moduleConfig as $controller => $controllerConfig) {
self::$acl->add(new Zend_Acl_Resource($module . '_' . $controller));
foreach ($controllerConfig as $action => $role) {
self::$acl->allow($role, $module . '_' . $controller, $action);
}
}
}
Zend_Registry::set('acl', self::$acl);
}

public static function setI18N()
{
if (self::$config->environment->locale == 'auto') {
$locale = new Zend_Locale(Zend_Locale::BROWSER);
} else {
$locale = new Zend_Locale(self::$config->environment->locale);
}
Zend_Registry::set('Zend_Locale', $locale);
$translate = new Zend_Translate('gettext',
APP_DIR . '/languages',
$locale->toString(),
array(
'scan' => Zend_Translate::LOCALE_DIRECTORY,
'disableNotices' => true));
Zend_Registry::set('Zend_Translate', $translate);

return $translate;
}

public static function setLayout()
{
$template = self::$config->environment->template;

// Hack: Explicitly add the ViewRenderer, so that when an exception is thrown,
// the layout is not shown (should be better handled in ZF 1.6)
// @see http://framework.zend.com/issues/browse/ZF-2993?focusedCommentId=23121#action_23121
Zend_Controller_Action_HelperBroker::addHelper(new Zend_Controller_Action_Helper_ViewRenderer());

Zend_Layout::startMvc(array(
'layoutPath' => $template == 'default'? APP_DIR.'/views/layouts' : APP_DIR."/views/layouts_$template",
));
}

public static function setFrontController()
{
self::$front = Zend_Controller_Front::getInstance();
self::$front->registerPlugin(new Monkeys_Controller_Plugin_Auth(self::$acl));
self::$front->addModuleDirectory(APP_DIR.'/modules');

$router = self::$front->getRouter();

if (self::$config->subdomain->enabled) {
if (self::$config->subdomain->use_www) {
$reqs = array('username' => '([^w]|w[^w][^w]|ww[^w]|www.+).*');
} else {
$reqs = array();
}
$hostNameRoute = new Zend_Controller_Router_Route_Hostname(
':username.' . self::$config->subdomain->hostname,
array(
'module' => 'default',
'controller' => 'identity',
'action' => 'id',
),
$reqs
);
$router->addRoute('hostNameRoute', $hostNameRoute);
}

$route = new Zend_Controller_Router_Route(
'identity/:userid',
array(
'module' => 'default',
'controller' => 'identity',
'action' => 'id',
),
array('userid' => '[\w-]*')
);
$router->addRoute('identityRoute', $route);
}

public static function dispatch()
{
self::$front->dispatch();
}
}

/**
* this is just a global function used to mark translations
*/
function translate() {}

26
bootstrap.php Executable file
View File

@ -0,0 +1,26 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

require 'Setup.php';

Setup::setIncludePath();
Setup::setAutoLoader();
Setup::setConfig();
Setup::setErrorReporting();
Setup::setLogger();
Setup::logRequest();
Setup::setDatabase();
Setup::setSession();
Setup::setAcl();
Setup::setI18N();
Setup::setLayout();
Setup::setFrontController();
Setup::dispatch();

94
config.default.php Normal file
View File

@ -0,0 +1,94 @@
<?php

#
# ------- ENVIRONMENT ------------
#
$config['environment']['installed'] = false;
$config['environment']['session_name'] = 'COMMUNITYID';
$config['environment']['production'] = true;
$config['environment']['YDN'] = true;
$config['environment']['ajax_slowdown'] = 0;
$config['environment']['keep_history_days'] = 90;

# Enable / Disable account self-registration.
$config['environment']['registrations_enabled'] = true;

# use auto to use the browser's language
$config['environment']['locale'] = 'auto';

$config['environment']['template'] = 'default';


#
# ------- HOME NEWS FEED ------------
#
$config['news_feed']['url'] = 'http://source.keyboard-monkeys.org/projects/communityid/news?format=atom';
$config['news_feed']['num_items'] = 3;


#
# ------- LOGGING ------------
#
# Enter a path relative to the installation's root dir, or an absolute path.
# The file must exist, and be writable by the web server user
$config['logging']['location'] = 'log.txt';

# Log level. You can use any of these constants or numbers:
# Zend_Log::EMERG = 0; // Emergency: system is unusable
# Zend_Log::ALERT = 1; // Alert: action must be taken immediately
# Zend_Log::CRIT = 2; // Critical: critical conditions
# Zend_Log::ERR = 3; // Error: error conditions
# Zend_Log::WARN = 4; // Warning: warning conditions
# Zend_Log::NOTICE = 5; // Notice: normal but significant condition
# Zend_Log::INFO = 6; // Informational: informational messages (requested URL, POST payloads)
# Zend_Log::DEBUG = 7; // Debug: debug messages (database queries)
$config['logging']['level'] = 0;


#
# ------- Subdomain openid URL configuration ------------
#
# Set to true for the OpenID URL identifying the user to have the form username.hostname
# All other URLs for non-OpenID transactions will be handled under the domain name, without a subdomain.
# Take a look at the wiki for more instructions on how to set this up.
# Warning: if you change this, all current OpenId credentials will become invalid.
$config['subdomain']['enabled'] = false;
# Enter your server's hostname (without www and without an ending slash)
# Community-id must be installed directly at this hostname's root web dir
$config['subdomain']['hostname'] = '';
# Set to true if your regular non-OpenId URLs are prepended with www
$config['subdomain']['use_www'] = true;


#
# ------- SSL ------------
#
# enable_mixed_mode: Set to true when you want to have the user authentication and all OpenID transactions
# to occur under SSL, and the rest to remain under a regular non-encrypted connection.
# Warning: if you change this, all current OpenId credentials will become invalid
$config['SSL']['enable_mixed_mode'] = false;


#
# ------- DATABASE ------------
#
$config['database']['adapter'] = 'mysqli';
$config['database']['params']['host'] = '';
$config['database']['params']['dbname'] = 'communityid';
$config['database']['params']['username'] = '';
$config['database']['params']['password'] = '';


#
# ------- E-MAIL ------------
#
$config['email']['supportemail'] = '';

# this email will receive any error notification
$config['email']['adminemail'] = '';

$config['email']['transport'] = 'sendmail';
$config['email']['host'] = '';
$config['email']['auth'] = '';
$config['email']['username'] = '';
$config['email']['password'] = '';

95
config.template.php Normal file
View File

@ -0,0 +1,95 @@
<?php

#
# ------- ENVIRONMENT ------------
#
$config['environment']['installed'] = {environment.installed};
$config['environment']['session_name'] = '{environment.session_name}';
$config['environment']['production'] = {environment.production};
$config['environment']['YDN'] = {environment.YDN};
$config['environment']['ajax_slowdown'] = {environment.ajax_slowdown};
$config['environment']['keep_history_days'] = {environment.keep_history_days};

# Enable / Disable account self-registration.
$config['environment']['registrations_enabled'] = {environment.registrations_enabled};

# use auto to use the browser's language
$config['environment']['locale'] = '{environment.locale}';

$config['environment']['template'] = '{environment.template}';
$config['environment']['news_feed'] = '{environment.news_feed}';


#
# ------- HOME NEWS FEED ------------
#
$config['news_feed']['url'] = '{news_feed.url}';
$config['news_feed']['num_items'] = {news_feed.num_items};


#
# ------- LOGGING ------------
#
# Enter a path relative to the installation's root dir, or an absolute path.
# The file must exist, and be writable by the web server user
$config['logging']['location'] = '{logging.location}';

# Log level. You can use any of these constants or numbers:
# Zend_Log::EMERG = 0; // Emergency: system is unusable
# Zend_Log::ALERT = 1; // Alert: action must be taken immediately
# Zend_Log::CRIT = 2; // Critical: critical conditions
# Zend_Log::ERR = 3; // Error: error conditions
# Zend_Log::WARN = 4; // Warning: warning conditions
# Zend_Log::NOTICE = 5; // Notice: normal but significant condition
# Zend_Log::INFO = 6; // Informational: informational messages (requested URL, POST payloads)
# Zend_Log::DEBUG = 7; // Debug: debug messages (database queries)
$config['logging']['level'] = {logging.level};


#
# ------- Subdomain openid URL configuration ------------
#
# Set to true for the OpenID URL identifying the user to have the form username.hostname
# All other URLs for non-OpenID transactions will be handled under the domain name, without a subdomain.
# Take a look at the wiki for more instructions on how to set this up.
# Warning: if you change this, all current OpenId credentials will become invalid.
$config['subdomain']['enabled'] = {subdomain.enabled};
# Enter your server's hostname (without www and without an ending slash)
# Community-id must be installed directly at this hostname's root web dir
$config['subdomain']['hostname'] = '{subdomain.hostname}';
# Set to true if your regular non-OpenId URLs are prepended with www
$config['subdomain']['use_www'] = {subdomain.use_www};


#
# ------- SSL ------------
#
# enable_mixed_mode: Set to true when you want to have the user authentication and all OpenID transactions
# to occur under SSL, and the rest to remain under a regular non-encrypted connection.
# Warning: if you change this, all current OpenId credentials will become invalid
$config['SSL']['enable_mixed_mode'] = {SSL.enable_mixed_mode};


#
# ------- DATABASE ------------
#
$config['database']['adapter'] = '{database.adapter}';
$config['database']['params']['host'] = '{database.params.host}';
$config['database']['params']['dbname'] = '{database.params.dbname}';
$config['database']['params']['username'] = '{database.params.username}';
$config['database']['params']['password'] = '{database.params.password}';


#
# ------- E-MAIL ------------
#
$config['email']['supportemail'] = '{email.supportemail}';

# this email will receive any error notification
$config['email']['adminemail'] = '{email.adminemail}';

$config['email']['transport'] = '{email.transport}';
$config['email']['host'] = '{email.host}';
$config['email']['auth'] = '{email.auth}';
$config['email']['username'] = '{email.username}';
$config['email']['password'] = '{email.password}';

43
index.html Normal file
View File

@ -0,0 +1,43 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Community-ID</title>
<link rel="shortcut icon" href="webdir/favicon.ico" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/assets/reset-fonts-grids/reset-fonts-grids.css">
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css">
<link rel="stylesheet" href="webdir/styles/style.css?v=<?= $this->version ?>" type="text/css" media="screen" charset="utf-8"/>
</head>
<body class="yui-skin-sam">
<div id="doc4">
<div id="hd">
<div id="logoAndLinks">
<img id="logo" src="webdir/images/logo.gif" />
</div>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b singleColumn" id="content">
<h2>
Your Community-ID installation is not properly set up
</h2>
<p>
The root directory of Community-ID must be placed outside the web root directory.
</p>
<p>
After you do that, make a symlink under your web root directory where you want to serve Community-ID, pointing to the "webdir" subdirectory of the Community-ID directory.
</p>
<p>
If for some reason you can't make symlinks, or you can't have your web server follow them, then just make a copy of the "webdir" directory, and then edit the index.php file, setting the APP_DIR constant to the location of the Community-ID root directory.
</p>
</div>
</div>
</div>
<div id="ft">
<div id="copyright">
<p>Copyright &#169; 2008-2009 Keyboard Monkeys Ltd. Community as a service &#x2122;</p>
</div>
</div>
</div>
</body>
</html>

BIN
languages/de/lang.mo Normal file

Binary file not shown.

887
languages/de/lang.po Normal file
View File

@ -0,0 +1,887 @@
msgid ""
msgstr ""
"Project-Id-Version: Community-ID English translation\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-15 00:13+0100\n"
"PO-Revision-Date: 2009-05-15 00:21+0100\n"
"Last-Translator: Reiner Jung <reiner@kb-m.com>\n"
"Language-Team: Reiner <reiner@kb-m.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: German\n"
"X-Poedit-KeywordsList: translate\n"
"X-Poedit-Basepath: ../../\n"
"X-Poedit-Country: GERMANY\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-SearchPath-0: modules\n"
"X-Poedit-SearchPath-1: views\n"
"X-Poedit-SearchPath-2: webdir/javascript\n"
"X-Poedit-SearchPath-3: libs/Monkeys\n"

#: modules/default/forms/ErrorMessages.php:20
msgid "Value is empty, but a non-empty value is required"
msgstr "Es wurden keine Daten eingegeben, dies ist nicht zulässig "

#: modules/default/forms/ErrorMessages.php:21
msgid "'%value%' is not a valid email address in the basic format local-part@hostname"
msgstr "'%value%' ist keine gültige E-Mail Adresse im Format name@domain"

#: modules/default/forms/ErrorMessages.php:22
msgid "Captcha value is wrong"
msgstr "Captcha-Wert ist falsch"

#: modules/default/forms/ErrorMessages.php:23
msgid "Password confirmation does not match"
msgstr "Das eingegebene Password stimmt nicht überein "

#: modules/default/forms/FeedbackForm.php:25
msgid "Enter your name"
msgstr "Geben Sie Ihren Namen ein"

#: modules/default/forms/FeedbackForm.php:30
msgid "Enter your E-mail"
msgstr "Geben Sie ihre E-Mail Adresse ein"

#: modules/default/forms/FeedbackForm.php:37
msgid "Enter your questions or comments"
msgstr "Geben Sie Ihre Fragen oder Kommentare ein"

#: modules/default/forms/FeedbackForm.php:44
msgid "Please enter the text below"
msgstr "Bitte geben Sie den folgenden Text ein"

#: modules/default/forms/OpenidLoginForm.php:17
msgid "Username"
msgstr "Benutzername"

#: modules/default/forms/OpenidLoginForm.php:22
msgid "Password"
msgstr "Passwort"

#: modules/default/forms/MessageUsersForm.php:17
msgid "Subject:"
msgstr "Betreff:"

#: modules/default/forms/MessageUsersForm.php:22
msgid "CC:"
msgstr "CC:"

#: modules/default/forms/MessageUsersForm.php:26
msgid "Body:"
msgstr "Body:"

#: modules/default/models/Field.php:39
msgid "Male"
msgstr "Mann"

#: modules/default/models/Field.php:40
msgid "Female"
msgstr "Frau"

#: modules/default/models/Fields.php:32
msgid "Nickname"
msgstr "Spitzname"

#: modules/default/models/Fields.php:33
msgid "E-mail"
msgstr "E-mail"

#: modules/default/models/Fields.php:34
msgid "Full Name"
msgstr "Kompletter Name"

#: modules/default/models/Fields.php:35
msgid "Date of Birth"
msgstr "Geburtsdatum"

#: modules/default/models/Fields.php:36
msgid "Gender"
msgstr "Geschlecht"

#: modules/default/models/Fields.php:37
msgid "Postal Code"
msgstr "Postleitzahl"

#: modules/default/models/Fields.php:38
msgid "Country"
msgstr "Land"

#: modules/default/models/Fields.php:39
msgid "Language"
msgstr "Sprache"

#: modules/default/models/Fields.php:40
msgid "Time Zone"
msgstr "Zeitzone"

#: modules/default/controllers/IndexController.php:50
msgid "Could not retrieve news items"
msgstr "Neue Nachrichten konnten nicht abgerufen werden"

#: modules/default/controllers/IndexController.php:65
msgid "Read More"
msgstr "Mehr lesen"

#: modules/default/controllers/MessageusersController.php:46
msgid "CC field must be a comma-separated list of valid E-mails"
msgstr "Das CC Feld erlaubt ein Komma-separierte Liste mit gültigen E-Mails"

#: modules/stats/controllers/SitesController.php:68
msgid "Trusted sites"
msgstr "Vertrauenswürdige Seiten"

#: modules/stats/controllers/SitesController.php:75
msgid "Sites per user"
msgstr "Seiten pro Benutzer"

#: modules/install/controllers/CredentialsController.php:185
#, php-format
msgid "The directory where Community-ID is installed must be writable by the web server user (%s). Another option is to create an EMPTY config.php file that is writable by that user."
msgstr "Der Ordner in welchem Community-ID installiert wurde beschreibbar sein für der Webserver Benutzer (%s). Eine andere Option ist eine LEERE config.php Datei zu erstellen und diese beschreibbar zu machen für diesen Benutzer."

#: modules/install/controllers/CredentialsController.php:188
#, php-format
msgid "The directory \"captchas\" under the web directory for Community-ID must be writable by the web server user (%s)"
msgstr "Der Webserver Benutzer (%s) muss Schreibrechte haben für den Ordner \"catchas\" "

#: modules/users/forms/ChangePasswordForm.php:18
#: modules/users/forms/AccountInfoForm.php:50
msgid "Enter password"
msgstr "Passwort eingeben"

#: modules/users/forms/ChangePasswordForm.php:24
#: modules/users/forms/AccountInfoForm.php:56
#: modules/users/forms/RegisterForm.php:54
msgid "Enter password again"
msgstr "Passwort erneut eingeben"

#: modules/users/forms/AccountInfoForm.php:30
#: modules/users/forms/RegisterForm.php:26
msgid "First Name"
msgstr "Vorname"

#: modules/users/forms/AccountInfoForm.php:35
#: modules/users/forms/RegisterForm.php:31
msgid "Last Name"
msgstr "Nachname"

#: modules/users/forms/LoginForm.php:8
msgid "USERNAME"
msgstr "BENUTZERNAME"

#: modules/users/forms/LoginForm.php:13
msgid "PASSWORD"
msgstr "PASSWORT"

#: modules/users/forms/RegisterForm.php:48
msgid "Enter desired password"
msgstr "Geben Sie das gewünschte Passwort ein"

#: modules/users/controllers/ManageusersController.php:25
msgid "User has been deleted successfully"
msgstr "Der Benutzer wurde erfolgreich gelöscht "

#: modules/users/controllers/ProfilegeneralController.php:76
#: modules/users/controllers/RegisterController.php:59
msgid "This username is already in use"
msgstr "Dieser Benutzername ist vergeben"

#: modules/users/controllers/ProfilegeneralController.php:85
#: modules/users/controllers/RegisterController.php:66
msgid "This E-mail is already in use"
msgstr "Diese E-Mail Adresse wird schon verwendet"

#: modules/users/controllers/ProfilegeneralController.php:243
msgid "Your acccount has been successfully deleted"
msgstr "Ihr Benutzerkonto wurde erfolgreich gelöscht"

#: modules/users/controllers/UserslistController.php:50
msgid "admin"
msgstr "Administrator"

#: modules/users/controllers/UserslistController.php:52
msgid "confirmed"
msgstr "bestätigt"

#: modules/users/controllers/UserslistController.php:54
msgid "unconfirmed"
msgstr "nicht bestätigt"

#: modules/users/controllers/RegisterController.php:26
msgid "Sorry, registrations are currently disabled"
msgstr "Sorry, die Anmeldung ist zur Zeit nicht möglich"

#: modules/users/controllers/RegisterController.php:104
msgid "Thank you."
msgstr "Vielen Dank"

#: modules/users/controllers/RegisterController.php:105
msgid "You will receive an E-mail with instructions to activate the account."
msgstr "Es wird Ihnen eine E-Mail zu-gesendet mit Informationen wie Sie das Benutzerkonto aktivieren können. "

#: modules/users/controllers/RegisterController.php:107
msgid "The account was created but the E-mail could not be sent"
msgstr "Das Benutzerkonto wurde erstellt aber die E-Mail konnte nicht versendet werden"

#: modules/users/controllers/RegisterController.php:222
msgid "Community-ID registration confirmation"
msgstr "Bestätigung der Community-ID Registrierung"

#: modules/users/controllers/RecoverpasswordController.php:51
msgid "This E-mail is not registered in the system"
msgstr "Diese E-Mail Adresse ist im System nicht vorhanden"

#: modules/users/controllers/RecoverpasswordController.php:82
#: modules/users/controllers/RecoverpasswordController.php:121
msgid "Community-ID password reset"
msgstr "Community-ID Passwort zurückgesetzt"

#: modules/users/controllers/RecoverpasswordController.php:84
msgid "Password reset E-mail has been sent"
msgstr "Die E-Mail zum zurücksetzen Ihres Passworts wurde versendet"

#: modules/users/controllers/RecoverpasswordController.php:123
msgid "You'll receive your new password via E-mail"
msgstr "Sie werden Ihr neues Passwort via E-Mail erhalten"

#: webdir/javascript/language.php:30
msgid "Name"
msgstr "Name"

#: webdir/javascript/language.php:31
msgid "Registration"
msgstr "Anmeldung"

#: webdir/javascript/language.php:32
msgid "Status"
msgstr "Status"

#: webdir/javascript/language.php:33
msgid "profile"
msgstr "profil"

#: webdir/javascript/language.php:34
msgid "delete"
msgstr "löschen"

#: webdir/javascript/language.php:35
msgid "Site"
msgstr "Seite"

#: webdir/javascript/language.php:36
msgid "view info exchanged"
msgstr "Ausgetauschte Informationen ansehen"

#: webdir/javascript/language.php:37
msgid "deny"
msgstr "verbieten"

#: webdir/javascript/language.php:38
msgid "allow"
msgstr "erlauben"

#: webdir/javascript/language.php:39
msgid "Are you sure you wish to send this message to ALL users?"
msgstr "Sind Sie sicher das Sie diese Nachricht an ALLE Benutzer senden möchten?"

#: webdir/javascript/language.php:40
msgid "Are you sure you wish to deny trust to this site?"
msgstr "Sind Sie sicher das Sie die Vertrauensstellung mit dieser Seite aufheben möchten?"

#: webdir/javascript/language.php:41
msgid "operation failed"
msgstr "Operation fehlgeschlagen"

#: webdir/javascript/language.php:42
msgid "Trust to the following site has been granted:"
msgstr "Die Vertrauensstellung mit dieser Seite wurde hergestellt:"

#: webdir/javascript/language.php:43
msgid "Trust the following site has been denied:"
msgstr "Die Vertrauensstellung mit dieser Seite wurde verweigert:"

#: webdir/javascript/language.php:44
msgid "ERROR. The server returned:"
msgstr "FEHLER: Der Server antwortet: "

#: webdir/javascript/language.php:45
msgid "Your relationship with the following site has been deleted:"
msgstr "Ihre Vertrauensstellung zu dieser Seite wurde gelöscht:"

#: webdir/javascript/language.php:46
msgid "The history log has been cleared"
msgstr "Die Historie wurde gelöscht"

#: webdir/javascript/language.php:47
msgid "Are you sure you wish to allow access to this site?"
msgstr "Sind Sie sicher das Sie den Zugriff für diese Seite erlauben möchten?"

#: webdir/javascript/language.php:48
msgid "Are you sure you wish to delete your relationship with this site?"
msgstr "Sind Sie sicher das Sie die Vertrauensstellung mit dieser Seite löschen möchten?"

#: webdir/javascript/language.php:49
msgid "Are you sure you wish to delete all the History Log?"
msgstr "Sind Sie sicher das Sie die Historie löschen möchten?"

#: webdir/javascript/language.php:50
msgid "Are you sure you wish to delete the user"
msgstr "Sind Sie sicher das Sie diesen Benutzer löschen möchten?"

#: webdir/javascript/language.php:51
msgid "Are you sure you wish to delete all the unconfirmed accounts?"
msgstr "Sind Sie sicher das Sie alle nicht bestätigten Benutzerkonten löschen möchten?"

#: webdir/javascript/language.php:52
msgid "Date"
msgstr "Datum"

#: webdir/javascript/language.php:53
msgid "Result"
msgstr "Ergebnisse"

#: webdir/javascript/language.php:54
msgid "No records found."
msgstr "Keine Einträge gefunden."

#: webdir/javascript/language.php:55
msgid "Loading..."
msgstr "Lade..."

#: webdir/javascript/language.php:56
msgid "Data error."
msgstr "Datenfehler."

#: webdir/javascript/language.php:57
msgid "Click to sort ascending"
msgstr "Klicken Sie, um aufsteigend zu sortieren"

#: webdir/javascript/language.php:58
msgid "Click to sort descending"
msgstr "Klicken Sie, um absteigend zu sortieren "

#: webdir/javascript/language.php:59
msgid "Authorized"
msgstr "autorisiert"

#: webdir/javascript/language.php:60
msgid "Denied"
msgstr "Verweigert"

#: webdir/javascript/language.php:61
msgid "of"
msgstr "von"

#: webdir/javascript/language.php:62
msgid "next"
msgstr "nächste"

#: webdir/javascript/language.php:63
msgid "prev"
msgstr "vorherige"

#: webdir/javascript/language.php:64
msgid "IP"
msgstr "IP"

#: libs/Monkeys/Form/Element/Country.php:36
msgid "-- Select a Country --"
msgstr "-- Wählen Sie ein Land --"

#: libs/Monkeys/Form/Element/Timezone.php:48
msgid "-- Select a Timezone --"
msgstr "-- Wählen Sie eine Zeitzone -- "

#: libs/Monkeys/Form/Element/Language.php:36
msgid "-- Select a Language --"
msgstr "-- Wählen Sie eine Sprache --"

#: libs/Monkeys/View/Helper/FormDateSelects.php:267
msgid "January"
msgstr "Januar"

#: libs/Monkeys/View/Helper/FormDateSelects.php:268
msgid "February"
msgstr "Februar "

#: libs/Monkeys/View/Helper/FormDateSelects.php:269
msgid "March"
msgstr "März "

#: libs/Monkeys/View/Helper/FormDateSelects.php:270
msgid "April"
msgstr "April"

#: libs/Monkeys/View/Helper/FormDateSelects.php:271
msgid "May"
msgstr "Mai"

#: libs/Monkeys/View/Helper/FormDateSelects.php:272
msgid "June"
msgstr "Juni"

#: libs/Monkeys/View/Helper/FormDateSelects.php:273
msgid "July"
msgstr "Juli "

#: libs/Monkeys/View/Helper/FormDateSelects.php:274
msgid "August"
msgstr "August"

#: libs/Monkeys/View/Helper/FormDateSelects.php:275
msgid "Septembre"
msgstr "September"

#: libs/Monkeys/View/Helper/FormDateSelects.php:276
msgid "October"
msgstr "Oktober"

#: libs/Monkeys/View/Helper/FormDateSelects.php:277
msgid "November"
msgstr "November"

#: libs/Monkeys/View/Helper/FormDateSelects.php:278
msgid "December"
msgstr "Dezember"

#: modules/default/views/scripts/feedback/index.phtml:1
msgid "In order to serve you better, we have provided the form below for your questions and comments"
msgstr "Um unseren Service zu verbessern, haben Sie die Möglichkeit das untenstehende Formular für Ihre Fragen und Kommentare zu benutzen"

#: modules/default/views/scripts/feedback/index.phtml:7
#: modules/default/views/scripts/messageusers/index.phtml:39
msgid "Send"
msgstr "Senden"

#: modules/default/views/scripts/messageusers/index.phtml:9
msgid "This message will be sent to all registered Community-ID users"
msgstr "Diese Nachricht wird an alle registrierten Community-ID Benutzer gesendet"

#: modules/default/views/scripts/messageusers/index.phtml:18
msgid "switch to Plain-Text"
msgstr "Zu Plain-Text umschalten"

#: modules/default/views/scripts/messageusers/index.phtml:21
msgid "switch to Rich-Text (HTML)"
msgstr "Zu Rich-Text umschalten (HTML)"

#: modules/default/views/scripts/privacy/index.phtml:1
msgid "Privacy Policy"
msgstr "Datenschutzrichtlinie"

#: modules/default/views/scripts/openid/trust.phtml:3
#, php-format
msgid "A site identifying as %s has asked for confirmation that %s is your identity URL."
msgstr "Eine Seite identifiziert als %s möchte die Bestätigung das %s Ihre gültige URL ist."

#: modules/default/views/scripts/openid/trust.phtml:9
msgid "It also requests this additional information about you:"
msgstr "Zusätzliche Informationen über Sie werden benötigt:"

#: modules/default/views/scripts/openid/trust.phtml:10
msgid "Fields are automatically filled according to the personal info stored in your community-id account."
msgstr "Felder werden automatisch ausgefüllt bezüglich den gespeichert persönlichen Informationen in ihrem Community-ID Konto."

#: modules/default/views/scripts/openid/trust.phtml:11
msgid "Fields marked with * are required."
msgstr "(Felder markiert mit einem (*) sind erforderlich) "

#: modules/default/views/scripts/openid/trust.phtml:19
#, php-format
msgid "The private policy can be found at %s"
msgstr "Die Datenschutzrichline ist verfügbar unter %s"

#: modules/default/views/scripts/openid/trust.phtml:24
msgid "Forever"
msgstr "Für immer"

#: modules/default/views/scripts/openid/trust.phtml:27
msgid "Allow"
msgstr "Erlauben"

#: modules/default/views/scripts/openid/trust.phtml:28
msgid "Deny"
msgstr "Verbieten"

#: modules/default/views/scripts/openid/login.phtml:5
msgid "Login"
msgstr "Anmelden "

#: modules/default/views/scripts/sites/index.phtml:15
msgid "Information Exchanged"
msgstr "Ausgetauschte Informationen"

#: modules/default/views/scripts/sites/index.phtml:17
msgid "Information exchanged with:"
msgstr "Informationen ausgetauscht mit: "

#: modules/default/views/scripts/sites/index.phtml:21
msgid "OK"
msgstr "OK"

#: modules/default/views/scripts/history/index.phtml:13
msgid "Clear History"
msgstr "Historie löschen"

#: modules/default/views/scripts_monkeys/index/subheader.phtml:3
msgid "Fed up with having to remember dozens of<br />usernames and passwords<br />for your favorite websites?"
msgstr "Starting"

#: modules/default/views/scripts_monkeys/index/subheader.phtml:4
msgid "Starting today<br />you'll only have to remember one"
msgstr "Von heute an müssen<br /> Sie sich nur noch eins erinnern"

#: modules/stats/views/scripts/authorizations/index.phtml:1
msgid "Authorizations per day"
msgstr "Berechtigungen pro Tag"

#: modules/stats/views/scripts/authorizations/index.phtml:3
#: modules/stats/views/scripts/registrations/index.phtml:3
#: modules/stats/views/scripts/sites/index.phtml:3
msgid "Select view"
msgstr "Ansicht wählen"

#: modules/stats/views/scripts/authorizations/index.phtml:5
#: modules/stats/views/scripts/registrations/index.phtml:5
#: modules/stats/views/scripts/sites/index.phtml:5
msgid "Last Week"
msgstr "Letzter Woche"

#: modules/stats/views/scripts/authorizations/index.phtml:6
#: modules/stats/views/scripts/registrations/index.phtml:7
#: modules/stats/views/scripts/sites/index.phtml:6
msgid "Last Year"
msgstr "Letztem Jahr"

#: modules/stats/views/scripts/registrations/index.phtml:1
msgid "Registrations per day"
msgstr "Anmeldungen pro Tag"

#: modules/stats/views/scripts/registrations/index.phtml:6
msgid "Last Month"
msgstr "Letztem Monat"

#: modules/stats/views/scripts/sites/index.phtml:1
msgid "Trusted Sites"
msgstr "Vertraute Seiten"

#: modules/stats/views/scripts/top/index.phtml:1
msgid "Top 10 Trusted Sites"
msgstr "Top 10 vertrauenswürdige Seiten"

#: modules/stats/views/scripts/top/index.phtml:7
#, php-format
msgid "%s users"
msgstr "%s Benutzer"

#: modules/install/views/scripts/complete/index.phtml:2
msgid "The installation was performed successfully"
msgstr "Die Installation war erfolgreich"

#: modules/install/views/scripts/complete/index.phtml:10
msgid "Finish"
msgstr "Beenden "

#: modules/install/views/scripts/credentials/index.phtml:2
msgid "Database and E-mail information"
msgstr "Datenbank und E-Mail informationen"

#: modules/install/views/scripts/index/index.phtml:2
msgid "This Community-ID instance hasn't been installed yet"
msgstr "Diese Community-ID Installation wurde noch nicht installiert"

#: modules/install/views/scripts/index/index.phtml:5
msgid "Proceed with installation"
msgstr "Mit der Installation fortfahren"

#: modules/install/views/scripts/permissions/index.phtml:2
msgid "Please correct the following problems before proceeding:"
msgstr "Bitte korrigieren Sie die folgenden Probleme bevor Sie fortfahren:"

#: modules/install/views/scripts/permissions/index.phtml:10
msgid "Check again"
msgstr "Nochmals überprüfen"

#: modules/users/views/scripts/login/index.phtml:3
#, php-format
msgid "Hello, %s"
msgstr "Hallo, %s"

#: modules/users/views/scripts/login/index.phtml:7
msgid "Account"
msgstr "Benutzerkonto"

#: modules/users/views/scripts/login/index.phtml:10
msgid "Personal Info"
msgstr "Persönliche Informationen "

#: modules/users/views/scripts/login/index.phtml:13
msgid "Sites database"
msgstr "Gespeicherte Seiten"

#: modules/users/views/scripts/login/index.phtml:16
msgid "History Log"
msgstr "Historie"

#: modules/users/views/scripts/login/index.phtml:19
msgid "Logout"
msgstr "Abmelden"

#: modules/users/views/scripts/login/index.phtml:24
msgid "Admin options"
msgstr "Administration "

#: modules/users/views/scripts/login/index.phtml:27
msgid "Manage Users"
msgstr "Benutzer verwalten"

#: modules/users/views/scripts/login/index.phtml:30
msgid "Message Users"
msgstr "Nachricht an Benutzer"

#: modules/users/views/scripts/login/index.phtml:34
msgid "Disable Maintenance Mode"
msgstr "Wartungsmodus deaktivieren "

#: modules/users/views/scripts/login/index.phtml:36
msgid "Enable Maintenance Mode"
msgstr "Wartungsmodus aktivieren"

#: modules/users/views/scripts/login/index.phtml:40
msgid "Statistics"
msgstr "Statistiken"

#: modules/users/views/scripts/login/index.phtml:47
msgid "User access is currently disabled for system maintenance.<br />Please try again later"
msgstr "Die Anmeldung ist zur Zeit nicht möglich wegen Wartungsarbeiten.<br />Bitte versuchen Sie es zu einem späteren Zeitpunkt nochmals"

#: modules/users/views/scripts/login/index.phtml:58
msgid "Remember me"
msgstr "An mich erinnern "

#: modules/users/views/scripts/login/index.phtml:61
msgid "Log in"
msgstr "Anmelden"

#: modules/users/views/scripts/login/index.phtml:67
msgid "Forgot you password?"
msgstr "Passwort vergessen?"

#: modules/users/views/scripts/login/index.phtml:73
msgid "You don't have an account?"
msgstr "Sie haben noch keine Benutzerkonto?"

#: modules/users/views/scripts/login/index.phtml:75
msgid "REGISTER NOW!"
msgstr "JETZT ANMELDEN!"

#: modules/users/views/scripts/manageusers/index.phtml:11
msgid "All"
msgstr "Alle"

#: modules/users/views/scripts/manageusers/index.phtml:14
msgid "Confirmed"
msgstr "Bestätigt"

#: modules/users/views/scripts/manageusers/index.phtml:17
msgid "Unconfirmed"
msgstr "Nicht bestätigt"

#: modules/users/views/scripts/manageusers/index.phtml:24
msgid "Total users:"
msgstr "Benutzer gesamt:"

#: modules/users/views/scripts/manageusers/index.phtml:25
msgid "Total confirmed users:"
msgstr "Anzahl bestätigter Benutzer"

#: modules/users/views/scripts/manageusers/index.phtml:26
msgid "Total unconfirmed users:"
msgstr "Anzahl unbestätigter Benutzer"

#: modules/users/views/scripts/manageusers/index.phtml:29
msgid "Add User"
msgstr "Benutzer hinzufügen"

#: modules/users/views/scripts/manageusers/index.phtml:31
msgid "Delete Unconfirmed Users"
msgstr "Nicht bestätigte Benutzer löschen"

#: modules/users/views/scripts/profile/index.phtml:13
msgid "Account info"
msgstr "Benutzerkonto Details"

#: modules/users/views/scripts/profile/index.phtml:17
msgid "Edit"
msgstr "Bearbeiten"

#: modules/users/views/scripts/profile/index.phtml:20
msgid "Change Password"
msgstr "Passwort ändern"

#: modules/users/views/scripts/profile/index.phtml:38
msgid "Delete Account"
msgstr "Konto löschen"

#: modules/users/views/scripts/profilegeneral/accountinfo.phtml:28
msgid "OpenID"
msgstr "OpenID"

#: modules/users/views/scripts/profilegeneral/editaccountinfo.phtml:13
#: modules/users/views/scripts/profilegeneral/changepassword.phtml:36
#: modules/users/views/scripts/personalinfo/edit.phtml:42
msgid "Save"
msgstr "Speichern"

#: modules/users/views/scripts/profilegeneral/editaccountinfo.phtml:14
#: modules/users/views/scripts/profilegeneral/changepassword.phtml:37
#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:23
#: modules/users/views/scripts/personalinfo/edit.phtml:43
msgid "Cancel"
msgstr "Abbrechen"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:3
msgid "Why do you want to delete your Community-ID account?"
msgstr "Warum beabsichtigen Sie Ihr Community-ID Benutzerkonto zu löschen?"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:4
msgid "Please check all that apply:"
msgstr "Bitte wählen Sie aus was zutrifft:"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:8
msgid "This was just a test account"
msgstr "Dies war nur ein Test Account "

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:11
msgid "I found a better service"
msgstr "Ich habe einen besseren Service gefunden"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:14
msgid "Service lacked some key features I needed"
msgstr "Wichtige Funktionen welche ich benötige waren nicht vorhanden"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:17
msgid "No particular reason"
msgstr "Kein besondere Grund"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:20
msgid "Additional comments:"
msgstr "Zusätzliche Kommentare:"

#: modules/users/views/scripts/recoverpassword/index.phtml:1
msgid "Please enter your E-mail below to receive a link to reset your password"
msgstr "Bitte geben Sie Ihre E-Mail ein und Sie erhalten einen Link zum Zurücksetzen Ihres Passworts"

#: modules/users/views/scripts/register/eula.phtml:1
msgid "Please read the following EULA in order to continue"
msgstr "Bitte lesen Sie die folgende EULA bevor Sie fortzufahren "

#: modules/users/views/scripts/register/eula.phtml:8
msgid "I AGREE"
msgstr "ICH STIMME ZU"

#: modules/users/views/scripts/register/eula.phtml:9
msgid "I DISAGREE"
msgstr "ICH STIMME NICHT ZU"

#: modules/users/views/scripts/register/index.phtml:1
msgid "Registration Form"
msgstr "Anmeldeformular"

#: modules/users/views/scripts/personalinfo/show.phtml:8
msgid "Not Entered"
msgstr "Nicht eingegeben"

#: modules/users/views/scripts/personalinfo/index.phtml:22
msgid "This information will be used to automatically populate registration fields to any OpenID transaction that requires so"
msgstr "Diese Informationen werden verwendet, um automatisch alle Felder auszufüllen währen einer OpenID Transaktion"

#: views/layouts_monkeys/layout.phtml:32
#: views/layouts/layout.phtml:32
msgid "Home"
msgstr "Home"

#: views/layouts_monkeys/layout.phtml:35
#: views/layouts/layout.phtml:35
msgid "Feedback"
msgstr "Feedback"

#: views/layouts_monkeys/layout.phtml:38
msgid "Help and Support"
msgstr "Hilfe und Support"

#: views/layouts_monkeys/layout.phtml:55
#: views/layouts/layout.phtml:52
msgid "Maintenance mode is enabled: user access is restricted"
msgstr "Der Wartungsmodus ist eingeschaltet und der Benutzer Zugang ist eingeschränkt"

#: views/layouts_monkeys/layout.phtml:75
msgid "Privacy"
msgstr "Datenschutz "

#: views/layouts_monkeys/layout.phtml:78
msgid "About Us"
msgstr "Über uns "

#: views/layouts_monkeys/layout.phtml:81
msgid "Contact Us"
msgstr "Kontakt "

#~ msgid "OPEN AN ACCOUNT NOW"
#~ msgstr "EIN BENUTZERKONTO ERSTELLEN"
#~ msgid "Latest News"
#~ msgstr "Letzte News"
#~ msgid "Arabic"
#~ msgstr "Arabisch"
#~ msgid "Bulgarian"
#~ msgstr "Bulgarisch"
#~ msgid "Danish"
#~ msgstr "Dänisch "
#~ msgid "German"
#~ msgstr "Deutsch"
#~ msgid "Greek"
#~ msgstr "Griechisch"
#~ msgid "English"
#~ msgstr "Englisch"
#~ msgid "Esperanto"
#~ msgstr "Esperanto"
#~ msgid "Spanish"
#~ msgstr "Spanisch"

#, fuzzy
#~ msgid "Fiji"
#~ msgstr "Beenden"

#, fuzzy
#~ msgid "Yiddish"
#~ msgstr "Beenden"

#, fuzzy
#~ msgid "Georgian"
#~ msgstr "Einloggen"

#, fuzzy
#~ msgid "Latin"
#~ msgstr "Administrator"

#, fuzzy
#~ msgid "Laothian"
#~ msgstr "Einloggen"

#, fuzzy
#~ msgid "Sindhi"
#~ msgstr "Senden"

#, fuzzy
#~ msgid "Tamil"
#~ msgstr "Administrator"
#~ msgid "Username:"
#~ msgstr "Benutzername:"
#~ msgid "E-mail:"
#~ msgstr "E-Mail:"
#~ msgid "LOGIN"
#~ msgstr "ANMELDEN"
#~ msgid "LOG IN"
#~ msgstr "ANMELDEN"

BIN
languages/en/lang.mo Normal file

Binary file not shown.

764
languages/en/lang.po Normal file
View File

@ -0,0 +1,764 @@
msgid ""
msgstr ""
"Project-Id-Version: Community-ID English translation\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-12 16:08-0500\n"
"PO-Revision-Date: 2009-05-12 16:09-0500\n"
"Last-Translator: Alejandro Pedraza <alejandro.pedraza@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: English\n"
"X-Poedit-KeywordsList: translate\n"
"X-Poedit-Basepath: ../../\n"
"X-Poedit-SearchPath-0: modules\n"
"X-Poedit-SearchPath-1: views\n"
"X-Poedit-SearchPath-2: webdir/javascript\n"

#: modules/default/models/Fields.php:32
msgid "Nickname"
msgstr "Nickname"

#: modules/default/models/Fields.php:33
#: modules/users/forms/AccountInfoForm.php:40
#: modules/users/forms/RegisterForm.php:36
#: modules/users/views/scripts/profilegeneral/accountinfo.phtml:20
msgid "E-mail"
msgstr "E-mail"

#: modules/default/models/Fields.php:34
msgid "Full Name"
msgstr "Full Name"

#: modules/default/models/Fields.php:35
msgid "Date of Birth"
msgstr "Date of Birth"

#: modules/default/models/Fields.php:36
msgid "Gender"
msgstr "Gender"

#: modules/default/models/Fields.php:37
msgid "Postal Code"
msgstr "Postal Code"

#: modules/default/models/Fields.php:38
msgid "Country"
msgstr "Country"

#: modules/default/models/Fields.php:39
msgid "Language"
msgstr "Language"

#: modules/default/models/Fields.php:40
msgid "Time Zone"
msgstr "Time Zone"

#: modules/default/models/Field.php:39
msgid "Male"
msgstr "Male"

#: modules/default/models/Field.php:40
msgid "Female"
msgstr "Female"

#: modules/default/controllers/IndexController.php:27
msgid "Could not retrieve news items"
msgstr "Could not retrieve news items"

#: modules/default/controllers/IndexController.php:42
msgid "Read More"
msgstr "Read More"

#: modules/default/controllers/MessageusersController.php:46
msgid "CC field must be a comma-separated list of valid E-mails"
msgstr "CC field must be a comma-separated list of valid E-mails"

#: modules/default/forms/OpenidLoginForm.php:17
#: modules/users/forms/AccountInfoForm.php:26
#: modules/users/forms/RegisterForm.php:43
#: modules/users/views/scripts/profilegeneral/accountinfo.phtml:4
msgid "Username"
msgstr "Username"

#: modules/default/forms/OpenidLoginForm.php:22
msgid "Password"
msgstr "Password"

#: modules/default/forms/MessageUsersForm.php:17
msgid "Subject:"
msgstr "Subject:"

#: modules/default/forms/MessageUsersForm.php:22
msgid "CC:"
msgstr "CC:"

#: modules/default/forms/MessageUsersForm.php:26
#: modules/default/views/scripts/messageusers/index.phtml:26
#: modules/default/views/scripts/messageusers/index.phtml:32
msgid "Body:"
msgstr "Body:"

#: modules/default/forms/FeedbackForm.php:25
msgid "Enter your name"
msgstr "Enter your name"

#: modules/default/forms/FeedbackForm.php:30
msgid "Enter your E-mail"
msgstr "Enter your E-mail"

#: modules/default/forms/FeedbackForm.php:37
msgid "Enter your questions or comments"
msgstr "Enter your questions or comments"

#: modules/default/forms/FeedbackForm.php:44
#: modules/users/forms/RegisterForm.php:59
msgid "Please enter the text below"
msgstr "Please enter the text below"

#: modules/default/forms/ErrorMessages.php:20
msgid "Value is empty, but a non-empty value is required"
msgstr "Value is empty, but a non-empty value is required"

#: modules/default/forms/ErrorMessages.php:21
msgid "'%value%' is not a valid email address in the basic format local-part@hostname"
msgstr "'%value%' is not a valid email address in the basic format name@domain"

#: modules/default/forms/ErrorMessages.php:22
msgid "Captcha value is wrong"
msgstr "Captcha value is wrong"

#: modules/default/forms/ErrorMessages.php:23
msgid "Password confirmation does not match"
msgstr "Password confirmation does not match"

#: modules/stats/controllers/SitesController.php:68
msgid "Trusted sites"
msgstr "Trusted sites"

#: modules/stats/controllers/SitesController.php:75
msgid "Sites per user"
msgstr "Sites per user"

#: modules/install/controllers/CredentialsController.php:185
#, php-format
msgid "The directory where Community-ID is installed must be writable by the web server user (%s). Another option is to create an EMPTY config.php file that is writable by that user."
msgstr "The directory where Community-ID is installed must be writable by the web server user (%s). Another option is to create an EMPTY config.php file that is writable by that user."

#: modules/install/controllers/CredentialsController.php:188
#, php-format
msgid "The directory \"captchas\" under the web directory for Community-ID must be writable by the web server user (%s)"
msgstr "The directory \"captchas\" under the web directory for Community-ID must be writable by the web server user (%s)"

#: modules/users/controllers/UserslistController.php:50
msgid "admin"
msgstr "admin"

#: modules/users/controllers/UserslistController.php:52
msgid "confirmed"
msgstr "confirmed"

#: modules/users/controllers/UserslistController.php:54
msgid "unconfirmed"
msgstr "unconfirmed"

#: modules/users/controllers/ProfilegeneralController.php:76
#: modules/users/controllers/RegisterController.php:59
msgid "This username is already in use"
msgstr "This username is already in use"

#: modules/users/controllers/ProfilegeneralController.php:85
#: modules/users/controllers/RegisterController.php:66
msgid "This E-mail is already in use"
msgstr "This E-mail is already in use"

#: modules/users/controllers/ProfilegeneralController.php:243
msgid "Your acccount has been successfully deleted"
msgstr "Your acccount has been successfully deleted"

#: modules/users/controllers/RegisterController.php:26
msgid "Sorry, registrations are currently disabled"
msgstr "Sorry, registrations are currently disabled"

#: modules/users/controllers/ManageusersController.php:25
msgid "User has been deleted successfully"
msgstr "User has been deleted successfully"

#: modules/users/forms/AccountInfoForm.php:30
#: modules/users/forms/RegisterForm.php:26
msgid "First Name"
msgstr "First Name"

#: modules/users/forms/AccountInfoForm.php:35
#: modules/users/forms/RegisterForm.php:31
msgid "Last Name"
msgstr "Last Name"

#: modules/users/forms/AccountInfoForm.php:50
#: modules/users/forms/ChangePasswordForm.php:18
msgid "Enter password"
msgstr "Enter password"

#: modules/users/forms/AccountInfoForm.php:56
#: modules/users/forms/RegisterForm.php:54
#: modules/users/forms/ChangePasswordForm.php:24
msgid "Enter password again"
msgstr "Enter password again"

#: modules/users/forms/LoginForm.php:8
msgid "USERNAME"
msgstr "USERNAME"

#: modules/users/forms/LoginForm.php:13
msgid "PASSWORD"
msgstr "PASSWORD"

#: modules/users/forms/RegisterForm.php:48
msgid "Enter desired password"
msgstr "Enter desired password"

#: webdir/javascript/language.php:30
#: modules/users/views/scripts/profilegeneral/accountinfo.phtml:12
msgid "Name"
msgstr "Name"

#: webdir/javascript/language.php:31
msgid "Registration"
msgstr "Registration"

#: webdir/javascript/language.php:32
msgid "Status"
msgstr "Status"

#: webdir/javascript/language.php:33
msgid "profile"
msgstr "profile"

#: webdir/javascript/language.php:34
msgid "delete"
msgstr "delete"

#: webdir/javascript/language.php:35
msgid "Site"
msgstr "Site"

#: webdir/javascript/language.php:36
msgid "view info exchanged"
msgstr "view info exchanged"

#: webdir/javascript/language.php:37
msgid "deny"
msgstr "deny"

#: webdir/javascript/language.php:38
msgid "allow"
msgstr "allow"

#: webdir/javascript/language.php:39
msgid "Are you sure you wish to send this message to ALL users?"
msgstr "Are you sure you wish to send this message to ALL users?"

#: webdir/javascript/language.php:40
msgid "Are you sure you wish to deny trust to this site?"
msgstr "Are you sure you wish to deny trust to this site?"

#: webdir/javascript/language.php:41
msgid "operation failed"
msgstr "operation failed"

#: webdir/javascript/language.php:42
msgid "Trust to the following site has been granted:"
msgstr "Trust to the following site has been granted:"

#: webdir/javascript/language.php:43
msgid "Trust the following site has been denied:"
msgstr "Trust the following site has been denied:"

#: webdir/javascript/language.php:44
msgid "ERROR. The server returned:"
msgstr "ERROR. The server returned:"

#: webdir/javascript/language.php:45
msgid "Your relationship with the following site has been deleted:"
msgstr "Your relationship with the following site has been deleted:"

#: webdir/javascript/language.php:46
msgid "The history log has been cleared"
msgstr "The history log has been cleared"

#: webdir/javascript/language.php:47
msgid "Are you sure you wish to allow access to this site?"
msgstr "Are you sure you wish to allow access to this site?"

#: webdir/javascript/language.php:48
msgid "Are you sure you wish to delete your relationship with this site?"
msgstr "Are you sure you wish to delete your relationship with this site?"

#: webdir/javascript/language.php:49
msgid "Are you sure you wish to delete all the History Log?"
msgstr "Are you sure you wish to delete all the History Log?"

#: webdir/javascript/language.php:50
msgid "Are you sure you wish to delete the user"
msgstr "Are you sure you wish to delete the user"

#: webdir/javascript/language.php:51
msgid "Are you sure you wish to delete all the unconfirmed accounts?"
msgstr "Are you sure you wish to delete all the unconfirmed accounts?"

#: webdir/javascript/language.php:52
msgid "Date"
msgstr "Date"

#: webdir/javascript/language.php:53
msgid "Result"
msgstr "Result"

#: webdir/javascript/language.php:54
msgid "No records found."
msgstr "No records found."

#: webdir/javascript/language.php:55
msgid "Loading..."
msgstr "Loading..."

#: webdir/javascript/language.php:56
msgid "Data error."
msgstr "Data error."

#: webdir/javascript/language.php:57
msgid "Click to sort ascending"
msgstr "Click to sort ascending"

#: webdir/javascript/language.php:58
msgid "Click to sort descending"
msgstr "Click to sort descending"

#: webdir/javascript/language.php:59
msgid "Authorized"
msgstr "Authorized"

#: webdir/javascript/language.php:60
msgid "Denied"
msgstr "Denied"

#: webdir/javascript/language.php:61
msgid "of"
msgstr "of"

#: webdir/javascript/language.php:62
msgid "next"
msgstr "next"

#: webdir/javascript/language.php:63
msgid "prev"
msgstr "prev"

#: webdir/javascript/language.php:64
msgid "IP"
msgstr "IP"

#: modules/default/views/scripts/privacy/index.phtml:1
msgid "Privacy Policy"
msgstr "Privacy Policy"

#: modules/default/views/scripts/messageusers/index.phtml:9
msgid "This message will be sent to all registered Community-ID users"
msgstr "This message will be sent to all registered Community-ID users"

#: modules/default/views/scripts/messageusers/index.phtml:18
msgid "switch to Plain-Text"
msgstr "switch to Plain-Text"

#: modules/default/views/scripts/messageusers/index.phtml:21
msgid "switch to Rich-Text (HTML)"
msgstr "switch to Rich-Text (HTML)"

#: modules/default/views/scripts/messageusers/index.phtml:39
#: modules/default/views/scripts/feedback/index.phtml:7
#: modules/install/views/scripts/credentials/index.phtml:12
#: modules/users/views/scripts/register/index.phtml:10
#: modules/users/views/scripts/recoverpassword/index.phtml:4
msgid "Send"
msgstr "Send"

#: modules/default/views/scripts/feedback/index.phtml:1
msgid "In order to serve you better, we have provided the form below for your questions and comments"
msgstr "In order to serve you better, we have provided the form below for your questions and comments"

#: modules/default/views/scripts/openid/trust.phtml:3
#, php-format
msgid "A site identifying as %s has asked for confirmation that %s is your identity URL."
msgstr "A site identifying as %s has asked for confirmation that %s is your identity URL."

#: modules/default/views/scripts/openid/trust.phtml:9
msgid "It also requests this additional information about you:"
msgstr "It also requests this additional information about you:"

#: modules/default/views/scripts/openid/trust.phtml:10
msgid "Fields are automatically filled according to the personal info stored in your community-id account."
msgstr "Fields are automatically filled according to the personal info stored in your community-id account."

#: modules/default/views/scripts/openid/trust.phtml:11
msgid "Fields marked with * are required."
msgstr "Fields marked with * are required."

#: modules/default/views/scripts/openid/trust.phtml:19
#, php-format
msgid "The private policy can be found at %s"
msgstr "The private policy can be found at %s"

#: modules/default/views/scripts/openid/trust.phtml:24
msgid "Forever"
msgstr "Forever"

#: modules/default/views/scripts/openid/trust.phtml:27
msgid "Allow"
msgstr "Allow"

#: modules/default/views/scripts/openid/trust.phtml:28
msgid "Deny"
msgstr "Deny"

#: modules/default/views/scripts/openid/login.phtml:5
msgid "Login"
msgstr "Login"

#: modules/default/views/scripts/index/index.phtml:17
msgid "OPEN AN ACCOUNT NOW"
msgstr "OPEN AN ACCOUNT NOW"

#: modules/default/views/scripts/index/index.phtml:22
msgid "Latest News"
msgstr "Latest News"

#: modules/default/views/scripts/sites/index.phtml:15
msgid "Information Exchanged"
msgstr "Information Exchanged"

#: modules/default/views/scripts/sites/index.phtml:17
msgid "Information exchanged with:"
msgstr "Information exchanged with:"

#: modules/default/views/scripts/sites/index.phtml:21
msgid "OK"
msgstr "OK"

#: modules/default/views/scripts/history/index.phtml:13
msgid "Clear History"
msgstr "Clear History"

#: modules/default/views/scripts_monkeys/index/subheader.phtml:3
msgid "Fed up with having to remember dozens of<br />usernames and passwords<br />for your favorite websites?"
msgstr "Fed up with having to remember dozens of<br />usernames and passwords<br />for your favorite websites?"

#: modules/default/views/scripts_monkeys/index/subheader.phtml:4
msgid "Starting today<br />you'll only have to remember one"
msgstr "Starting today<br />you'll only have to remember one"

#: modules/stats/views/scripts/authorizations/index.phtml:1
msgid "Authorizations per day"
msgstr "Authorizations per day"

#: modules/stats/views/scripts/authorizations/index.phtml:3
#: modules/stats/views/scripts/registrations/index.phtml:3
#: modules/stats/views/scripts/sites/index.phtml:3
msgid "Select view"
msgstr "Select view"

#: modules/stats/views/scripts/authorizations/index.phtml:5
#: modules/stats/views/scripts/registrations/index.phtml:5
#: modules/stats/views/scripts/sites/index.phtml:5
msgid "Last Week"
msgstr "Last Week"

#: modules/stats/views/scripts/authorizations/index.phtml:6
#: modules/stats/views/scripts/registrations/index.phtml:7
#: modules/stats/views/scripts/sites/index.phtml:6
msgid "Last Year"
msgstr "Last Year"

#: modules/stats/views/scripts/registrations/index.phtml:1
msgid "Registrations per day"
msgstr "Registrations per day"

#: modules/stats/views/scripts/registrations/index.phtml:6
msgid "Last Month"
msgstr "Last Month"

#: modules/stats/views/scripts/top/index.phtml:1
msgid "Top 10 Trusted Sites"
msgstr "Top 10 Trusted Sites"

#: modules/stats/views/scripts/top/index.phtml:7
#, php-format
msgid "%s users"
msgstr "%s users"

#: modules/stats/views/scripts/sites/index.phtml:1
msgid "Trusted Sites"
msgstr "Trusted Sites"

#: modules/install/views/scripts/complete/index.phtml:2
msgid "The installation was performed successfully"
msgstr "The installation was performed successfully"

#: modules/install/views/scripts/complete/index.phtml:10
msgid "Finish"
msgstr "Finish"

#: modules/install/views/scripts/permissions/index.phtml:2
msgid "Please correct the following problems before proceeding:"
msgstr "Please correct the following problems before proceeding:"

#: modules/install/views/scripts/permissions/index.phtml:10
msgid "Check again"
msgstr "Check again"

#: modules/install/views/scripts/credentials/index.phtml:2
msgid "Database and E-mail information"
msgstr "Database and E-mail information"

#: modules/install/views/scripts/index/index.phtml:2
msgid "This Community-ID instance hasn't been installed yet"
msgstr "This Community-ID instance hasn't been installed yet"

#: modules/install/views/scripts/index/index.phtml:5
msgid "Proceed with installation"
msgstr "Proceed with installation"

#: modules/users/views/scripts/register/index.phtml:1
msgid "Registration Form"
msgstr "Registration Form"

#: modules/users/views/scripts/personalinfo/edit.phtml:42
#: modules/users/views/scripts/profilegeneral/editaccountinfo.phtml:13
#: modules/users/views/scripts/profilegeneral/changepassword.phtml:36
msgid "Save"
msgstr "Save"

#: modules/users/views/scripts/personalinfo/edit.phtml:43
#: modules/users/views/scripts/profilegeneral/editaccountinfo.phtml:14
#: modules/users/views/scripts/profilegeneral/changepassword.phtml:37
#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:23
msgid "Cancel"
msgstr "Cancel"

#: modules/users/views/scripts/personalinfo/show.phtml:8
msgid "Not Entered"
msgstr "Not Entered"

#: modules/users/views/scripts/personalinfo/index.phtml:13
#: modules/users/views/scripts/login/index.phtml:10
#: modules/users/views/scripts_monkeys/login/index.phtml:10
msgid "Personal Info"
msgstr "Personal Info"

#: modules/users/views/scripts/personalinfo/index.phtml:16
#: modules/users/views/scripts/profile/index.phtml:17
msgid "Edit"
msgstr "Edit"

#: modules/users/views/scripts/personalinfo/index.phtml:22
msgid "This information will be used to automatically populate registration fields to any OpenID transaction that requires so"
msgstr "This information will be used to automatically populate registration fields to any OpenID transaction that requires so"

#: modules/users/views/scripts/recoverpassword/index.phtml:1
msgid "Please enter your E-mail below to receive a link to reset your password"
msgstr "Please enter your E-mail below to receive a link to reset your password"

#: modules/users/views/scripts/profile/index.phtml:13
msgid "Account info"
msgstr "Account info"

#: modules/users/views/scripts/profile/index.phtml:20
msgid "Change Password"
msgstr "Change Password"

#: modules/users/views/scripts/profile/index.phtml:38
#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:22
msgid "Delete Account"
msgstr "Delete Account"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:3
msgid "Why do you want to delete your Community-ID account?"
msgstr "Why do you want to delete your Community-ID account?"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:4
msgid "Please check all that apply:"
msgstr "Please check all that apply:"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:8
msgid "This was just a test account"
msgstr "This was just a test account"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:11
msgid "I found a better service"
msgstr "I found a better service"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:14
msgid "Service lacked some key features I needed"
msgstr "Service lacked some key features I needed"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:17
msgid "No particular reason"
msgstr "No particular reason"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:20
msgid "Additional comments:"
msgstr "Additional comments:"

#: modules/users/views/scripts/profilegeneral/accountinfo.phtml:28
msgid "OpenID"
msgstr "OpenID"

#: modules/users/views/scripts/login/index.phtml:3
#: modules/users/views/scripts_monkeys/login/index.phtml:3
#, php-format
msgid "Hello, %s"
msgstr "Hello, %s"

#: modules/users/views/scripts/login/index.phtml:7
#: modules/users/views/scripts_monkeys/login/index.phtml:7
msgid "Account"
msgstr "Account"

#: modules/users/views/scripts/login/index.phtml:13
#: modules/users/views/scripts_monkeys/login/index.phtml:13
msgid "Sites database"
msgstr "Sites database"

#: modules/users/views/scripts/login/index.phtml:16
#: modules/users/views/scripts_monkeys/login/index.phtml:16
msgid "History Log"
msgstr "History Log"

#: modules/users/views/scripts/login/index.phtml:19
#: modules/users/views/scripts_monkeys/login/index.phtml:19
msgid "Logout"
msgstr "Logout"

#: modules/users/views/scripts/login/index.phtml:24
#: modules/users/views/scripts_monkeys/login/index.phtml:24
msgid "Admin options"
msgstr "Admin options"

#: modules/users/views/scripts/login/index.phtml:27
#: modules/users/views/scripts_monkeys/login/index.phtml:27
msgid "Manage Users"
msgstr "Manage Users"

#: modules/users/views/scripts/login/index.phtml:30
#: modules/users/views/scripts_monkeys/login/index.phtml:30
msgid "Message Users"
msgstr "Message Users"

#: modules/users/views/scripts/login/index.phtml:34
#: modules/users/views/scripts_monkeys/login/index.phtml:34
msgid "Disable Maintenance Mode"
msgstr "Disable Maintenance Mode"

#: modules/users/views/scripts/login/index.phtml:36
#: modules/users/views/scripts_monkeys/login/index.phtml:36
msgid "Enable Maintenance Mode"
msgstr "Enable Maintenance Mode"

#: modules/users/views/scripts/login/index.phtml:40
#: modules/users/views/scripts_monkeys/login/index.phtml:40
msgid "Statistics"
msgstr "Statistics"

#: modules/users/views/scripts/login/index.phtml:47
#: modules/users/views/scripts_monkeys/login/index.phtml:50
msgid "User access is currently disabled for system maintenance.<br />Please try again later"
msgstr "User access is currently disabled for system maintenance.<br />Please try again later"

#: modules/users/views/scripts/login/index.phtml:58
#: modules/users/views/scripts_monkeys/login/index.phtml:61
msgid "Remember me"
msgstr "Remember me"

#: modules/users/views/scripts/login/index.phtml:61
#: modules/users/views/scripts_monkeys/login/index.phtml:64
msgid "Log in"
msgstr "Log in"

#: modules/users/views/scripts/login/index.phtml:67
#: modules/users/views/scripts_monkeys/login/index.phtml:70
msgid "Forgot you password?"
msgstr "Forgot you password?"

#: modules/users/views/scripts/login/index.phtml:73
#: modules/users/views/scripts_monkeys/login/index.phtml:76
msgid "You don't have an account?"
msgstr "You don't have an account?"

#: modules/users/views/scripts/login/index.phtml:75
#: modules/users/views/scripts_monkeys/login/index.phtml:78
msgid "REGISTER NOW!"
msgstr "REGISTER NOW!"

#: modules/users/views/scripts/manageusers/index.phtml:11
msgid "All"
msgstr "All"

#: modules/users/views/scripts/manageusers/index.phtml:14
msgid "Confirmed"
msgstr "Confirmed"

#: modules/users/views/scripts/manageusers/index.phtml:17
msgid "Unconfirmed"
msgstr "Unconfirmed"

#: modules/users/views/scripts/manageusers/index.phtml:24
msgid "Total users:"
msgstr "Total users:"

#: modules/users/views/scripts/manageusers/index.phtml:25
msgid "Total confirmed users:"
msgstr "Total confirmed users:"

#: modules/users/views/scripts/manageusers/index.phtml:26
msgid "Total unconfirmed users:"
msgstr "Total unconfirmed users:"

#: modules/users/views/scripts/manageusers/index.phtml:29
msgid "Add User"
msgstr "Add User"

#: modules/users/views/scripts/manageusers/index.phtml:31
msgid "Delete Unconfirmed Users"
msgstr "Delete Unconfirmed Users"

#: views/layouts_monkeys/layout.phtml:32
#: views/layouts/layout.phtml:32
msgid "Home"
msgstr "Home"

#: views/layouts_monkeys/layout.phtml:35
#: views/layouts/layout.phtml:35
msgid "Feedback"
msgstr "Feedback"

#: views/layouts_monkeys/layout.phtml:38
msgid "Help and Support"
msgstr "Help and Support"

#: views/layouts_monkeys/layout.phtml:55
#: views/layouts/layout.phtml:52
msgid "Maintenance mode is enabled: user access is restricted"
msgstr "Maintenance mode is enabled: user access is restricted"

#: views/layouts_monkeys/layout.phtml:75
msgid "Privacy"
msgstr "Privacy"

#: views/layouts_monkeys/layout.phtml:78
msgid "About Us"
msgstr "About Us"

#: views/layouts_monkeys/layout.phtml:81
msgid "Contact Us"
msgstr "Contact Us"

BIN
languages/es/lang.mo Normal file

Binary file not shown.

871
languages/es/lang.po Normal file
View File

@ -0,0 +1,871 @@
msgid ""
msgstr ""
"Project-Id-Version: Community-ID Spanish translation\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-13 11:41-0500\n"
"PO-Revision-Date: 2009-05-13 11:42-0500\n"
"Last-Translator: Alejandro Pedraza <alejandro.pedraza@gmail.com>\n"
"Language-Team: Keyboard Monkeys Ltd. <alejandro@kb-m.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: Spanish\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-KeywordsList: translate\n"
"X-Poedit-Basepath: ../../\n"
"X-Poedit-SearchPath-0: modules\n"
"X-Poedit-SearchPath-1: views\n"
"X-Poedit-SearchPath-2: webdir/javascript\n"
"X-Poedit-SearchPath-3: libs/Monkeys\n"

#: modules/default/models/Fields.php:32
msgid "Nickname"
msgstr "Sobrenombre"

#: modules/default/models/Fields.php:33
#: modules/users/forms/AccountInfoForm.php:40
#: modules/users/forms/RegisterForm.php:36
#: modules/users/views/scripts/profilegeneral/accountinfo.phtml:20
msgid "E-mail"
msgstr "Correo electrónico"

#: modules/default/models/Fields.php:34
msgid "Full Name"
msgstr "Nombre Completo"

#: modules/default/models/Fields.php:35
msgid "Date of Birth"
msgstr "Fecha de Nacimiento"

#: modules/default/models/Fields.php:36
msgid "Gender"
msgstr "Género"

#: modules/default/models/Fields.php:37
msgid "Postal Code"
msgstr "Código Postal"

#: modules/default/models/Fields.php:38
msgid "Country"
msgstr "País"

#: modules/default/models/Fields.php:39
msgid "Language"
msgstr "Idioma"

#: modules/default/models/Fields.php:40
msgid "Time Zone"
msgstr "Zona Horaria"

#: modules/default/models/Field.php:39
msgid "Male"
msgstr "Hombre"

#: modules/default/models/Field.php:40
msgid "Female"
msgstr "Mujer"

#: modules/default/controllers/IndexController.php:27
msgid "Could not retrieve news items"
msgstr "No fue posible extraer las noticias"

#: modules/default/controllers/IndexController.php:42
msgid "Read More"
msgstr "Leer Más"

#: modules/default/controllers/MessageusersController.php:46
msgid "CC field must be a comma-separated list of valid E-mails"
msgstr "El campo CC debe ser una lista de E-mails válidos separados por comas"

#: modules/default/forms/OpenidLoginForm.php:17
#: modules/users/forms/AccountInfoForm.php:26
#: modules/users/forms/RegisterForm.php:43
#: modules/users/views/scripts/profilegeneral/accountinfo.phtml:4
msgid "Username"
msgstr "Nombre de usuario"

#: modules/default/forms/OpenidLoginForm.php:22
msgid "Password"
msgstr "Contraseña"

#: modules/default/forms/MessageUsersForm.php:17
msgid "Subject:"
msgstr "Asunto:"

#: modules/default/forms/MessageUsersForm.php:22
msgid "CC:"
msgstr "CC:"

#: modules/default/forms/MessageUsersForm.php:26
#: modules/default/views/scripts/messageusers/index.phtml:26
#: modules/default/views/scripts/messageusers/index.phtml:32
msgid "Body:"
msgstr "Contenido:"

#: modules/default/forms/FeedbackForm.php:25
msgid "Enter your name"
msgstr "Ingrese su nombre"

#: modules/default/forms/FeedbackForm.php:30
msgid "Enter your E-mail"
msgstr "Ingrese su correo electrónico"

#: modules/default/forms/FeedbackForm.php:37
msgid "Enter your questions or comments"
msgstr "Ingrese sus preguntas o comentarios"

#: modules/default/forms/FeedbackForm.php:44
#: modules/users/forms/RegisterForm.php:59
msgid "Please enter the text below"
msgstr "Por favor ingrese el siguiente texto"

#: modules/default/forms/ErrorMessages.php:20
msgid "Value is empty, but a non-empty value is required"
msgstr "Se requiere un valor no vacío"

#: modules/default/forms/ErrorMessages.php:21
msgid "'%value%' is not a valid email address in the basic format local-part@hostname"
msgstr "'%value%' no es un correo electrónico válido"

#: modules/default/forms/ErrorMessages.php:22
msgid "Captcha value is wrong"
msgstr "El valor del texto está errado"

#: modules/default/forms/ErrorMessages.php:23
msgid "Password confirmation does not match"
msgstr "Las contraseñas no coinciden"

#: modules/stats/controllers/SitesController.php:68
msgid "Trusted sites"
msgstr "Sitios de confianza"

#: modules/stats/controllers/SitesController.php:75
msgid "Sites per user"
msgstr "Sitios por usuario"

#: modules/install/controllers/CredentialsController.php:185
#, php-format
msgid "The directory where Community-ID is installed must be writable by the web server user (%s). Another option is to create an EMPTY config.php file that is writable by that user."
msgstr "El directorio donde Community-ID está instalado debe ser escribible por el usuario del servidor web (%s). Otra opción es create un archivo config.php VACIO que sea escribible por dicho usuario."

#: modules/install/controllers/CredentialsController.php:188
#, php-format
msgid "The directory \"captchas\" under the web directory for Community-ID must be writable by the web server user (%s)"
msgstr "El directorio \"catpchas\" debajo del directorio web de Community-ID debe ser escribible por el usuario del servidor web (%s)"

#: modules/users/controllers/UserslistController.php:50
msgid "admin"
msgstr "admin"

#: modules/users/controllers/UserslistController.php:52
msgid "confirmed"
msgstr "confirmado"

#: modules/users/controllers/UserslistController.php:54
msgid "unconfirmed"
msgstr "no confirmado"

#: modules/users/controllers/ProfilegeneralController.php:76
#: modules/users/controllers/RegisterController.php:59
msgid "This username is already in use"
msgstr "Este nombre de usuario ya está en uso"

#: modules/users/controllers/ProfilegeneralController.php:85
#: modules/users/controllers/RegisterController.php:66
msgid "This E-mail is already in use"
msgstr "Este correo electrónico ya está en uso"

#: modules/users/controllers/ProfilegeneralController.php:243
msgid "Your acccount has been successfully deleted"
msgstr "Su cuenta ha sido borrada con éxito"

#: modules/users/controllers/RegisterController.php:26
msgid "Sorry, registrations are currently disabled"
msgstr "Lo sentimos, los nuevos registros están actualmente deshabilitados"

#: modules/users/controllers/RegisterController.php:104
msgid "Thank you."
msgstr "Gracias."

#: modules/users/controllers/RegisterController.php:105
msgid "You will receive an E-mail with instructions to activate the account."
msgstr "Recibirá por correo electrónico las instrucciones para activar la cuenta."

#: modules/users/controllers/RegisterController.php:107
msgid "The account was created but the E-mail could not be sent"
msgstr "La cuenta fue creada pero el correo electrónico no pudo ser enviado"

#: modules/users/controllers/RegisterController.php:222
msgid "Community-ID registration confirmation"
msgstr "Community-ID confirmación de registro"

#: modules/users/controllers/RecoverpasswordController.php:51
msgid "This E-mail is not registered in the system"
msgstr "Este correo electrónico no está registrado en el sistema"

#: modules/users/controllers/RecoverpasswordController.php:82
#: modules/users/controllers/RecoverpasswordController.php:121
msgid "Community-ID password reset"
msgstr "Community-ID restablecimiento de contraseña"

#: modules/users/controllers/RecoverpasswordController.php:84
msgid "Password reset E-mail has been sent"
msgstr "El correo electrónico de restablecimiento de contraseña ha sido enviado"

#: modules/users/controllers/RecoverpasswordController.php:123
msgid "You'll receive your new password via E-mail"
msgstr "Recibirá la nueva contraseña por correo electrónico"

#: modules/users/controllers/ManageusersController.php:25
msgid "User has been deleted successfully"
msgstr "El usuario ha sido borrado con éxito"

#: modules/users/forms/AccountInfoForm.php:30
#: modules/users/forms/RegisterForm.php:26
msgid "First Name"
msgstr "Nombre"

#: modules/users/forms/AccountInfoForm.php:35
#: modules/users/forms/RegisterForm.php:31
msgid "Last Name"
msgstr "Apellido"

#: modules/users/forms/AccountInfoForm.php:50
#: modules/users/forms/ChangePasswordForm.php:18
msgid "Enter password"
msgstr "Ingrese contraseña"

#: modules/users/forms/AccountInfoForm.php:56
#: modules/users/forms/RegisterForm.php:54
#: modules/users/forms/ChangePasswordForm.php:24
msgid "Enter password again"
msgstr "Ingrese contraseña de nuevo"

#: modules/users/forms/LoginForm.php:8
msgid "USERNAME"
msgstr "NOMBRE DE USUARIO"

#: modules/users/forms/LoginForm.php:13
msgid "PASSWORD"
msgstr "CONTRASEÑA"

#: modules/users/forms/RegisterForm.php:48
msgid "Enter desired password"
msgstr "Ingrese contraseña deseada"

#: webdir/javascript/language.php:30
#: modules/users/views/scripts/profilegeneral/accountinfo.phtml:12
msgid "Name"
msgstr "Nombre"

#: webdir/javascript/language.php:31
msgid "Registration"
msgstr "Registro"

#: webdir/javascript/language.php:32
msgid "Status"
msgstr "Estado"

#: webdir/javascript/language.php:33
msgid "profile"
msgstr "perfil"

#: webdir/javascript/language.php:34
msgid "delete"
msgstr "eliminar"

#: webdir/javascript/language.php:35
msgid "Site"
msgstr "Sitio"

#: webdir/javascript/language.php:36
msgid "view info exchanged"
msgstr "ver información intercambiada"

#: webdir/javascript/language.php:37
msgid "deny"
msgstr "denegar"

#: webdir/javascript/language.php:38
msgid "allow"
msgstr "permitir"

#: webdir/javascript/language.php:39
msgid "Are you sure you wish to send this message to ALL users?"
msgstr "¿Está seguro de querer enviar este mensaje a TODOS los usuarios?"

#: webdir/javascript/language.php:40
msgid "Are you sure you wish to deny trust to this site?"
msgstr "¿Está seguro de querer denegar este sitio?"

#: webdir/javascript/language.php:41
msgid "operation failed"
msgstr "la operación ha fallado"

#: webdir/javascript/language.php:42
msgid "Trust to the following site has been granted:"
msgstr "Confianza para el siguiente sitio ha sido otorgada:"

#: webdir/javascript/language.php:43
msgid "Trust the following site has been denied:"
msgstr "Confianza para el siguiente sitio ha sido denegada:"

#: webdir/javascript/language.php:44
msgid "ERROR. The server returned:"
msgstr "ERROR. El servidor retornó:"

#: webdir/javascript/language.php:45
msgid "Your relationship with the following site has been deleted:"
msgstr "Su relación con el siguiente sitio has sido eliminada:"

#: webdir/javascript/language.php:46
msgid "The history log has been cleared"
msgstr "El historial ha sido borrado"

#: webdir/javascript/language.php:47
msgid "Are you sure you wish to allow access to this site?"
msgstr "¿Está seguro de querer otorgar acceso a este sitio?"

#: webdir/javascript/language.php:48
msgid "Are you sure you wish to delete your relationship with this site?"
msgstr "¿Está seguro de querer elimiar su relación con este sitio?"

#: webdir/javascript/language.php:49
msgid "Are you sure you wish to delete all the History Log?"
msgstr "¿Está seguro de querer borrar todo el historial?"

#: webdir/javascript/language.php:50
msgid "Are you sure you wish to delete the user"
msgstr "Está seguro de querer eliminar el usuario"

#: webdir/javascript/language.php:51
msgid "Are you sure you wish to delete all the unconfirmed accounts?"
msgstr "¿Está seguro de querer eliminar todas las cuentas no confirmadas?"

#: webdir/javascript/language.php:52
msgid "Date"
msgstr "Fecha"

#: webdir/javascript/language.php:53
msgid "Result"
msgstr "Resultado"

#: webdir/javascript/language.php:54
msgid "No records found."
msgstr "No se encontraron registros."

#: webdir/javascript/language.php:55
msgid "Loading..."
msgstr "Cargando..."

#: webdir/javascript/language.php:56
msgid "Data error."
msgstr "Error de datos."

#: webdir/javascript/language.php:57
msgid "Click to sort ascending"
msgstr "Haga click para ordenar ascendentemente"

#: webdir/javascript/language.php:58
msgid "Click to sort descending"
msgstr "Haga click para ordenar descendentemente"

#: webdir/javascript/language.php:59
msgid "Authorized"
msgstr "Autorizado"

#: webdir/javascript/language.php:60
msgid "Denied"
msgstr "Denegado"

#: webdir/javascript/language.php:61
msgid "of"
msgstr "de"

#: webdir/javascript/language.php:62
msgid "next"
msgstr "sig"

#: webdir/javascript/language.php:63
msgid "prev"
msgstr "ant"

#: webdir/javascript/language.php:64
msgid "IP"
msgstr "IP"

#: libs/Monkeys/Form/Element/Language.php:36
msgid "-- Select a Language --"
msgstr "-- Seleccione un Idioma --"

#: libs/Monkeys/Form/Element/Timezone.php:48
msgid "-- Select a Timezone --"
msgstr "-- Seleccione una zona horaria --"

#: libs/Monkeys/Form/Element/Country.php:36
msgid "-- Select a Country --"
msgstr "-- Seleccione un País --"

#: libs/Monkeys/View/Helper/FormDateSelects.php:267
msgid "January"
msgstr "Enero"

#: libs/Monkeys/View/Helper/FormDateSelects.php:268
msgid "February"
msgstr "Febrero"

#: libs/Monkeys/View/Helper/FormDateSelects.php:269
msgid "March"
msgstr "Marzo"

#: libs/Monkeys/View/Helper/FormDateSelects.php:270
msgid "April"
msgstr "Abrilperfil"

#: libs/Monkeys/View/Helper/FormDateSelects.php:271
msgid "May"
msgstr "Mayo"

#: libs/Monkeys/View/Helper/FormDateSelects.php:272
msgid "June"
msgstr "Junio"

#: libs/Monkeys/View/Helper/FormDateSelects.php:273
msgid "July"
msgstr "Julio"

#: libs/Monkeys/View/Helper/FormDateSelects.php:274
msgid "August"
msgstr "Agosto"

#: libs/Monkeys/View/Helper/FormDateSelects.php:275
msgid "Septembre"
msgstr "Septiembre"

#: libs/Monkeys/View/Helper/FormDateSelects.php:276
msgid "October"
msgstr "Octubre"

#: libs/Monkeys/View/Helper/FormDateSelects.php:277
msgid "November"
msgstr "Noviembre"

#: libs/Monkeys/View/Helper/FormDateSelects.php:278
msgid "December"
msgstr "Diciembre"

#: modules/default/views/scripts/privacy/index.phtml:1
msgid "Privacy Policy"
msgstr "Política de Privacidad"

#: modules/default/views/scripts/messageusers/index.phtml:9
msgid "This message will be sent to all registered Community-ID users"
msgstr "Este mensaje será enviado a todos los usuarios registrados de Community-ID"

#: modules/default/views/scripts/messageusers/index.phtml:18
msgid "switch to Plain-Text"
msgstr "cambiar a texto plano"

#: modules/default/views/scripts/messageusers/index.phtml:21
msgid "switch to Rich-Text (HTML)"
msgstr "cambiar a texto enriquecido (HTML)"

#: modules/default/views/scripts/messageusers/index.phtml:39
#: modules/default/views/scripts/feedback/index.phtml:7
#: modules/install/views/scripts/credentials/index.phtml:12
#: modules/users/views/scripts/register/index.phtml:10
#: modules/users/views/scripts/recoverpassword/index.phtml:4
msgid "Send"
msgstr "Enviar"

#: modules/default/views/scripts/feedback/index.phtml:1
msgid "In order to serve you better, we have provided the form below for your questions and comments"
msgstr "Para poder servirle mejor, hemos creado el formulario a continuación para sus preguntas y comentarios"

#: modules/default/views/scripts/openid/trust.phtml:3
#, php-format
msgid "A site identifying as %s has asked for confirmation that %s is your identity URL."
msgstr "Un sitio identificado como %s a pedido confirmación de que %s es la URL de su identidad"

#: modules/default/views/scripts/openid/trust.phtml:9
msgid "It also requests this additional information about you:"
msgstr "También se requiere la siguiente información adicional:"

#: modules/default/views/scripts/openid/trust.phtml:10
msgid "Fields are automatically filled according to the personal info stored in your community-id account."
msgstr "Los campos son automaticamente llenados de acuerdo con la información personal guardada en su cuenta de community-id."

#: modules/default/views/scripts/openid/trust.phtml:11
msgid "Fields marked with * are required."
msgstr "Los campos marcados con * son requeridos"

#: modules/default/views/scripts/openid/trust.phtml:19
#, php-format
msgid "The private policy can be found at %s"
msgstr "La política de privacidad puede ser vista en %s"

#: modules/default/views/scripts/openid/trust.phtml:24
msgid "Forever"
msgstr "Para siempre"

#: modules/default/views/scripts/openid/trust.phtml:27
msgid "Allow"
msgstr "Permitir"

#: modules/default/views/scripts/openid/trust.phtml:28
msgid "Deny"
msgstr "Denegar"

#: modules/default/views/scripts/openid/login.phtml:5
msgid "Login"
msgstr "Ingresar"

#: modules/default/views/scripts/index/index.phtml:17
msgid "OPEN AN ACCOUNT NOW"
msgstr "ABRA UNA CUENTA AHORA"

#: modules/default/views/scripts/index/index.phtml:22
msgid "Latest News"
msgstr "Ultimas Noticias"

#: modules/default/views/scripts/sites/index.phtml:15
msgid "Information Exchanged"
msgstr "Información Intercambiada"

#: modules/default/views/scripts/sites/index.phtml:17
msgid "Information exchanged with:"
msgstr "Información intercambiada con:"

#: modules/default/views/scripts/sites/index.phtml:21
msgid "OK"
msgstr "OK"

#: modules/default/views/scripts/history/index.phtml:13
msgid "Clear History"
msgstr "Borra Historial"

#: modules/default/views/scripts_monkeys/index/subheader.phtml:3
msgid "Fed up with having to remember dozens of<br />usernames and passwords<br />for your favorite websites?"
msgstr "Está cansado de tener que recordar docenas de<br />nombres de usuario y contraseñas<br />para sus sitios favoritos?"

#: modules/default/views/scripts_monkeys/index/subheader.phtml:4
msgid "Starting today<br />you'll only have to remember one"
msgstr "A partir de hoy<br />solo tendrá que recordar una"

#: modules/stats/views/scripts/authorizations/index.phtml:1
msgid "Authorizations per day"
msgstr "Autorizaciones por día"

#: modules/stats/views/scripts/authorizations/index.phtml:3
#: modules/stats/views/scripts/registrations/index.phtml:3
#: modules/stats/views/scripts/sites/index.phtml:3
msgid "Select view"
msgstr "Seleccionar vista"

#: modules/stats/views/scripts/authorizations/index.phtml:5
#: modules/stats/views/scripts/registrations/index.phtml:5
#: modules/stats/views/scripts/sites/index.phtml:5
msgid "Last Week"
msgstr "Semana Pasada"

#: modules/stats/views/scripts/authorizations/index.phtml:6
#: modules/stats/views/scripts/registrations/index.phtml:7
#: modules/stats/views/scripts/sites/index.phtml:6
msgid "Last Year"
msgstr "Año Pasado"

#: modules/stats/views/scripts/registrations/index.phtml:1
msgid "Registrations per day"
msgstr "Registros por día"

#: modules/stats/views/scripts/registrations/index.phtml:6
msgid "Last Month"
msgstr "Ultimo Mes"

#: modules/stats/views/scripts/top/index.phtml:1
msgid "Top 10 Trusted Sites"
msgstr "Primeros 10 Sitios de Confianza"

#: modules/stats/views/scripts/top/index.phtml:7
#, php-format
msgid "%s users"
msgstr "%s usuarios"

#: modules/stats/views/scripts/sites/index.phtml:1
msgid "Trusted Sites"
msgstr "Sitios de confianza"

#: modules/install/views/scripts/complete/index.phtml:2
msgid "The installation was performed successfully"
msgstr "La instalación fue exitosa"

#: modules/install/views/scripts/complete/index.phtml:10
msgid "Finish"
msgstr "Terminar"

#: modules/install/views/scripts/permissions/index.phtml:2
msgid "Please correct the following problems before proceeding:"
msgstr "Por favor corrija los siguientes problemas antes de proceder:"

#: modules/install/views/scripts/permissions/index.phtml:10
msgid "Check again"
msgstr "Chequear de nuevo"

#: modules/install/views/scripts/credentials/index.phtml:2
msgid "Database and E-mail information"
msgstr "Información de la base de datos y correo electrónico"

#: modules/install/views/scripts/index/index.phtml:2
msgid "This Community-ID instance hasn't been installed yet"
msgstr "Esta instancia de Community-ID no ha sido instalada aún"

#: modules/install/views/scripts/index/index.phtml:5
msgid "Proceed with installation"
msgstr "Proceder con la instalación"

#: modules/users/views/scripts/register/eula.phtml:1
msgid "Please read the following EULA in order to continue"
msgstr "Por favor lea los siguientes Terminos de Uso para continuar"

#: modules/users/views/scripts/register/eula.phtml:8
msgid "I AGREE"
msgstr "DE ACUERDO"

#: modules/users/views/scripts/register/eula.phtml:9
msgid "I DISAGREE"
msgstr "EN DESACUERDO"

#: modules/users/views/scripts/register/index.phtml:1
msgid "Registration Form"
msgstr "Formulario de Registro"

#: modules/users/views/scripts/personalinfo/edit.phtml:42
#: modules/users/views/scripts/profilegeneral/editaccountinfo.phtml:13
#: modules/users/views/scripts/profilegeneral/changepassword.phtml:36
msgid "Save"
msgstr "Guardar"

#: modules/users/views/scripts/personalinfo/edit.phtml:43
#: modules/users/views/scripts/profilegeneral/editaccountinfo.phtml:14
#: modules/users/views/scripts/profilegeneral/changepassword.phtml:37
#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:23
msgid "Cancel"
msgstr "Cancelar"

#: modules/users/views/scripts/personalinfo/show.phtml:8
msgid "Not Entered"
msgstr "No Ingresado"

#: modules/users/views/scripts/personalinfo/index.phtml:13
#: modules/users/views/scripts/login/index.phtml:10
#: modules/users/views/scripts_monkeys/login/index.phtml:10
msgid "Personal Info"
msgstr "Información Personal"

#: modules/users/views/scripts/personalinfo/index.phtml:16
#: modules/users/views/scripts/profile/index.phtml:17
msgid "Edit"
msgstr "Editar"

#: modules/users/views/scripts/personalinfo/index.phtml:22
msgid "This information will be used to automatically populate registration fields to any OpenID transaction that requires so"
msgstr "Esta información será usada automáticamente para llenar los campos de registro en cualquier transacción OpenID que lo requiera"

#: modules/users/views/scripts/recoverpassword/index.phtml:1
msgid "Please enter your E-mail below to receive a link to reset your password"
msgstr "Por favor ingrese su correo electrónico para recibir un enlace para restablecer su contraseña"

#: modules/users/views/scripts/profile/index.phtml:13
msgid "Account info"
msgstr "Información de la Cuenta"

#: modules/users/views/scripts/profile/index.phtml:20
msgid "Change Password"
msgstr "Cambiar contraseña"

#: modules/users/views/scripts/profile/index.phtml:38
#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:22
msgid "Delete Account"
msgstr "Eliminar Cuenta"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:3
msgid "Why do you want to delete your Community-ID account?"
msgstr "¿Por qué desea eliminar su cuenta de Community-ID?"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:4
msgid "Please check all that apply:"
msgstr "Por favor chequee todo lo que aplique:"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:8
msgid "This was just a test account"
msgstr "Esta era solo una cuenta de prueba"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:11
msgid "I found a better service"
msgstr "Encontré otro servicio mejor"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:14
msgid "Service lacked some key features I needed"
msgstr "El servico carece de funcionalidades clave que requiero"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:17
msgid "No particular reason"
msgstr "Ninguna razón en particular"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:20
msgid "Additional comments:"
msgstr "Comentarios adicionales:"

#: modules/users/views/scripts/profilegeneral/accountinfo.phtml:28
msgid "OpenID"
msgstr "OpenID"

#: modules/users/views/scripts/login/index.phtml:3
#: modules/users/views/scripts_monkeys/login/index.phtml:3
#, php-format
msgid "Hello, %s"
msgstr "Hola, %s"

#: modules/users/views/scripts/login/index.phtml:7
#: modules/users/views/scripts_monkeys/login/index.phtml:7
msgid "Account"
msgstr "Cuenta"

#: modules/users/views/scripts/login/index.phtml:13
#: modules/users/views/scripts_monkeys/login/index.phtml:13
msgid "Sites database"
msgstr "Base de datos de Sitios"

#: modules/users/views/scripts/login/index.phtml:16
#: modules/users/views/scripts_monkeys/login/index.phtml:16
msgid "History Log"
msgstr "Historial"

#: modules/users/views/scripts/login/index.phtml:19
#: modules/users/views/scripts_monkeys/login/index.phtml:19
msgid "Logout"
msgstr "Salir"

#: modules/users/views/scripts/login/index.phtml:24
#: modules/users/views/scripts_monkeys/login/index.phtml:24
msgid "Admin options"
msgstr "Opciones de Adminstración"

#: modules/users/views/scripts/login/index.phtml:27
#: modules/users/views/scripts_monkeys/login/index.phtml:27
msgid "Manage Users"
msgstr "Manejar Usuarios"

#: modules/users/views/scripts/login/index.phtml:30
#: modules/users/views/scripts_monkeys/login/index.phtml:30
msgid "Message Users"
msgstr "Enviar Mensaje a Usuarios"

#: modules/users/views/scripts/login/index.phtml:34
#: modules/users/views/scripts_monkeys/login/index.phtml:34
msgid "Disable Maintenance Mode"
msgstr "Deshabilitar Modo de Mantenimiento"

#: modules/users/views/scripts/login/index.phtml:36
#: modules/users/views/scripts_monkeys/login/index.phtml:36
msgid "Enable Maintenance Mode"
msgstr "Habilitar Modo de Mantenimiento"

#: modules/users/views/scripts/login/index.phtml:40
#: modules/users/views/scripts_monkeys/login/index.phtml:40
msgid "Statistics"
msgstr "Estadísticas"

#: modules/users/views/scripts/login/index.phtml:47
#: modules/users/views/scripts_monkeys/login/index.phtml:50
msgid "User access is currently disabled for system maintenance.<br />Please try again later"
msgstr "El acceso está actualmente deshabilitado debido a mantenimiento del sistema.<br />Por favor intente más tarde"

#: modules/users/views/scripts/login/index.phtml:58
#: modules/users/views/scripts_monkeys/login/index.phtml:61
msgid "Remember me"
msgstr "Recuérdeme"

#: modules/users/views/scripts/login/index.phtml:61
#: modules/users/views/scripts_monkeys/login/index.phtml:64
msgid "Log in"
msgstr "Ingresar"

#: modules/users/views/scripts/login/index.phtml:67
#: modules/users/views/scripts_monkeys/login/index.phtml:70
msgid "Forgot you password?"
msgstr "¿Olvidó su contraseña?"

#: modules/users/views/scripts/login/index.phtml:73
#: modules/users/views/scripts_monkeys/login/index.phtml:76
msgid "You don't have an account?"
msgstr "¿No tiene una cuenta?"

#: modules/users/views/scripts/login/index.phtml:75
#: modules/users/views/scripts_monkeys/login/index.phtml:78
msgid "REGISTER NOW!"
msgstr "¡REGISTRESE AHORA!"

#: modules/users/views/scripts/manageusers/index.phtml:11
msgid "All"
msgstr "Todos"

#: modules/users/views/scripts/manageusers/index.phtml:14
msgid "Confirmed"
msgstr "Confirmados"

#: modules/users/views/scripts/manageusers/index.phtml:17
msgid "Unconfirmed"
msgstr "No confirmados"

#: modules/users/views/scripts/manageusers/index.phtml:24
msgid "Total users:"
msgstr "Total usuarios:"

#: modules/users/views/scripts/manageusers/index.phtml:25
msgid "Total confirmed users:"
msgstr "Total usuarios confirmados:"

#: modules/users/views/scripts/manageusers/index.phtml:26
msgid "Total unconfirmed users:"
msgstr "Total usuarios no confirmados:"

#: modules/users/views/scripts/manageusers/index.phtml:29
msgid "Add User"
msgstr "Agregar Usuario"

#: modules/users/views/scripts/manageusers/index.phtml:31
msgid "Delete Unconfirmed Users"
msgstr "Eliminar Usuarios no Confirmados"

#: views/layouts_monkeys/layout.phtml:32
#: views/layouts/layout.phtml:32
msgid "Home"
msgstr "Inicio"

#: views/layouts_monkeys/layout.phtml:35
#: views/layouts/layout.phtml:35
msgid "Feedback"
msgstr "Retroalimentación"

#: views/layouts_monkeys/layout.phtml:38
msgid "Help and Support"
msgstr "Ayuda y Soporte"

#: views/layouts_monkeys/layout.phtml:55
#: views/layouts/layout.phtml:52
msgid "Maintenance mode is enabled: user access is restricted"
msgstr "El modo de mantenimiento está habilitado: el acceso a usuarios está restringido"

#: views/layouts_monkeys/layout.phtml:75
msgid "Privacy"
msgstr "Privacidad"

#: views/layouts_monkeys/layout.phtml:78
msgid "About Us"
msgstr "Sobre Nosotros"

#: views/layouts_monkeys/layout.phtml:81
msgid "Contact Us"
msgstr "Contáctenos"

BIN
languages/nl/lang.mo Normal file

Binary file not shown.

722
languages/nl/lang.po Normal file
View File

@ -0,0 +1,722 @@
msgid ""
msgstr ""
"Project-Id-Version: Community-ID English translation\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-08 23:26+0100\n"
"PO-Revision-Date: 2009-05-08 23:26+0100\n"
"Last-Translator: Stanley Westerveld <stanley@westlands.org>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: English\n"
"X-Poedit-KeywordsList: translate\n"
"X-Poedit-Basepath: ../../\n"
"X-Poedit-SearchPath-0: modules\n"
"X-Poedit-SearchPath-1: views\n"
"X-Poedit-SearchPath-2: webdir/javascript\n"

#: modules/default/controllers/IndexController.php:27
msgid "Could not retrieve news items"
msgstr "Kon geen nieuws items ophalen"

#: modules/default/controllers/IndexController.php:42
msgid "Read More"
msgstr "Lees verder"

#: modules/default/controllers/MessageusersController.php:46
msgid "CC field must be a comma-separated list of valid E-mails"
msgstr "Het CC veld moet een door komma's gescheiden lijst van geldige E-mail adressen zijn"

#: modules/default/forms/ErrorMessages.php:20
msgid "Value is empty, but a non-empty value is required"
msgstr "Waarde is leeg, deze mag niet leeg zijn"

#: modules/default/forms/ErrorMessages.php:21
msgid "'%value%' is not a valid email address in the basic format local-part@hostname"
msgstr "'%value%' is geen valide E-mail adres in het formaat local-part@hostname"

#: modules/default/forms/ErrorMessages.php:22
msgid "Captcha value is wrong"
msgstr "De Captcha inhoud is onjuist"

#: modules/default/forms/ErrorMessages.php:23
msgid "Password confirmation does not match"
msgstr "Wachtwoord bevestiging komt niet overeen"

#: modules/default/forms/FeedbackForm.php:25
msgid "Enter your name"
msgstr "Vul je naam in:"

#: modules/default/forms/FeedbackForm.php:30
msgid "Enter your E-mail"
msgstr "Vul je E-mail adres in:"

#: modules/default/forms/FeedbackForm.php:37
msgid "Enter your questions or comments"
msgstr "Vul je vragen of reaktie in:"

#: modules/default/forms/FeedbackForm.php:44
msgid "Please enter the text below"
msgstr "Vul onderstaande tekst in:"

#: modules/default/forms/MessageUsersForm.php:17
msgid "Subject:"
msgstr "Onderwerp:"

#: modules/default/forms/MessageUsersForm.php:22
msgid "CC:"
msgstr "CC:"

#: modules/default/forms/MessageUsersForm.php:26
msgid "Body:"
msgstr "Inhoud:"

#: modules/default/forms/OpenidLoginForm.php:17
msgid "Username"
msgstr "Gebruikersnaam"

#: modules/default/forms/OpenidLoginForm.php:22
msgid "Password"
msgstr "Wachtwoord"

#: modules/default/models/Field.php:39
msgid "Male"
msgstr "Man"

#: modules/default/models/Field.php:40
msgid "Female"
msgstr "Vrouw"

#: modules/default/models/Fields.php:32
msgid "Nickname"
msgstr "Nickname"

#: modules/default/models/Fields.php:33
msgid "E-mail"
msgstr "E-mail"

#: modules/default/models/Fields.php:34
msgid "Full Name"
msgstr "Volledige naam"

#: modules/default/models/Fields.php:35
msgid "Date of Birth"
msgstr "Geboortedatum"

#: modules/default/models/Fields.php:36
msgid "Gender"
msgstr "Geslacht"

#: modules/default/models/Fields.php:37
msgid "Postal Code"
msgstr "Postcode"

#: modules/default/models/Fields.php:38
msgid "Country"
msgstr "Land"

#: modules/default/models/Fields.php:39
msgid "Language"
msgstr "Taal"

#: modules/default/models/Fields.php:40
msgid "Time Zone"
msgstr "Tijdzone"

#: modules/install/controllers/CredentialsController.php:185
#, php-format
msgid "The directory where Community-ID is installed must be writable by the web server user (%s). Another option is to create an EMPTY config.php file that is writable by that user."
msgstr "De directory waar Community-ID geinstalleerd is moet schrijfbaar zijn voor de web server user (%s). Een andere mogelijkheid is om een LEEG config.php dat schrijfbaar is voor (%s) aan te maken."

#: modules/install/controllers/CredentialsController.php:188
#, php-format
msgid "The directory \"captchas\" under the web directory for Community-ID must be writable by the web server user (%s)"
msgstr "De directory \"captchas\" onder de web directory voor Community-ID moet schrijfbaar zijn voor de web server user (%s)"

#: modules/stats/controllers/SitesController.php:68
msgid "Trusted sites"
msgstr "Vertrouwde sites"

#: modules/stats/controllers/SitesController.php:75
msgid "Sites per user"
msgstr "Sites per gebruiker"

#: modules/users/controllers/ManageusersController.php:25
msgid "User has been deleted successfully"
msgstr "Gebruiker is succesvol verwijderd"

#: modules/users/controllers/ProfilegeneralController.php:76
#: modules/users/controllers/RegisterController.php:59
msgid "This username is already in use"
msgstr "Deze gebruikersnaam is in gebruik"

#: modules/users/controllers/ProfilegeneralController.php:85
#: modules/users/controllers/RegisterController.php:66
msgid "This E-mail is already in use"
msgstr "Dit E-mail adres is in gebruik"

#: modules/users/controllers/ProfilegeneralController.php:243
msgid "Your acccount has been successfully deleted"
msgstr "Je account is succesvol verwijderd"

#: modules/users/controllers/RegisterController.php:26
msgid "Sorry, registrations are currently disabled"
msgstr "Sorry, registratie is momenteel niet mogelijk"

#: modules/users/controllers/UserslistController.php:50
msgid "admin"
msgstr "admin"

#: modules/users/controllers/UserslistController.php:52
msgid "confirmed"
msgstr "bevestigd"

#: modules/users/controllers/UserslistController.php:54
msgid "unconfirmed"
msgstr "onbevestigd"

#: modules/users/forms/AccountInfoForm.php:30
msgid "First Name"
msgstr "Voornaam:"

#: modules/users/forms/AccountInfoForm.php:35
msgid "Last Name"
msgstr "Achternaam:"

#: modules/users/forms/AccountInfoForm.php:50
#: modules/users/forms/ChangePasswordForm.php:18
msgid "Enter password"
msgstr "Vul wachtwoord in:"

#: modules/users/forms/AccountInfoForm.php:56
#: modules/users/forms/ChangePasswordForm.php:24
msgid "Enter password again"
msgstr "Vul wachtwoord nogmaals in:"

#: modules/users/forms/LoginForm.php:8
msgid "USERNAME"
msgstr "GEBRUIKERSNAAM"

#: modules/users/forms/LoginForm.php:13
msgid "PASSWORD"
msgstr "WACHTWOORD"

#: modules/users/forms/RegisterForm.php:48
msgid "Enter desired password"
msgstr "Vul gewenste wachtwoord in:"

#: webdir/javascript/language.php:30
msgid "Name"
msgstr "Naam"

#: webdir/javascript/language.php:31
msgid "Registration"
msgstr "Registratie"

#: webdir/javascript/language.php:32
msgid "Status"
msgstr "Status"

#: webdir/javascript/language.php:33
msgid "profile"
msgstr "profiel"

#: webdir/javascript/language.php:34
msgid "delete"
msgstr "verwijder"

#: webdir/javascript/language.php:35
msgid "Site"
msgstr "Site"

#: webdir/javascript/language.php:36
msgid "view info exchanged"
msgstr "bekijk uitgewisselde informatie"

#: webdir/javascript/language.php:37
msgid "deny"
msgstr "weiger"

#: webdir/javascript/language.php:38
msgid "allow"
msgstr "sta toe"

#: webdir/javascript/language.php:39
msgid "Are you sure you wish to send this message to ALL users?"
msgstr "Weet je zeker dat je dit bericht aan ALLE gebruikers wilt verzenden?"

#: webdir/javascript/language.php:40
msgid "Are you sure you wish to deny trust to this site?"
msgstr "Weet je zeker dat je geen vertrouwen aan deze site wilt toekennen?"

#: webdir/javascript/language.php:41
msgid "operation failed"
msgstr "handeling mislukt"

#: webdir/javascript/language.php:42
msgid "Trust to the following site has been granted:"
msgstr "Vertrouwen is aan de volgende site toegekend:"

#: webdir/javascript/language.php:43
msgid "Trust the following site has been denied:"
msgstr "Vertrouwen is niet toegekend aan de volgende site:"

#: webdir/javascript/language.php:44
msgid "ERROR. The server returned:"
msgstr "ERROR. De server meldt:"

#: webdir/javascript/language.php:45
msgid "Your relationship with the following site has been deleted:"
msgstr "Je relatie met de volgende site is verwijderd:"

#: webdir/javascript/language.php:46
msgid "The history log has been cleared"
msgstr "De historische logs zijn verwijderd"

#: webdir/javascript/language.php:47
msgid "Are you sure you wish to allow access to this site?"
msgstr "Weet je zeker dat je toegang wilt geven aan deze site?"

#: webdir/javascript/language.php:48
msgid "Are you sure you wish to delete your relationship with this site?"
msgstr "Weet je zeker dat je de relatie met deze site wilt verwijderen?"

#: webdir/javascript/language.php:49
msgid "Are you sure you wish to delete all the History Log?"
msgstr "Weet je zeker dat je alle historische logs wilt verwijderen?"

#: webdir/javascript/language.php:50
msgid "Are you sure you wish to delete the user"
msgstr "Weet je zeker dat je de gebruiker wilt verwijderen"

#: webdir/javascript/language.php:51
msgid "Are you sure you wish to delete all the unconfirmed accounts?"
msgstr "Weet je zeker dat je alle onbevestigde accounts wilt verwijderen?"

#: webdir/javascript/language.php:52
msgid "Date"
msgstr "Datum"

#: webdir/javascript/language.php:53
msgid "Result"
msgstr "Resultaat"

#: webdir/javascript/language.php:54
msgid "No records found."
msgstr "Geen resultaten gevonden."

#: webdir/javascript/language.php:55
msgid "Loading..."
msgstr "Laden..."

#: webdir/javascript/language.php:56
msgid "Data error."
msgstr "Data error."

#: webdir/javascript/language.php:57
msgid "Click to sort ascending"
msgstr "Klik om oplopend te sorteren"

#: webdir/javascript/language.php:58
msgid "Click to sort descending"
msgstr "Klik om aflopend te sorteren"

#: webdir/javascript/language.php:59
msgid "Authorized"
msgstr "Toegestaan"

#: webdir/javascript/language.php:60
msgid "Denied"
msgstr "Geweigerd"

#: webdir/javascript/language.php:61
msgid "of"
msgstr "of"

#: webdir/javascript/language.php:62
msgid "next"
msgstr "volgende"

#: webdir/javascript/language.php:63
msgid "prev"
msgstr "vorige"

#: webdir/javascript/language.php:64
msgid "IP"
msgstr "IP"

#: modules/default/views/scripts/feedback/index.phtml:1
msgid "In order to serve you better, we have provided the form below for your questions and comments"
msgstr "Om je beter van dienst te kunnen zijn bieden wij je via onderstaand formulier de mogelijkheid om je vragen en opmerkingen kenbaar te maken"

#: modules/default/views/scripts/feedback/index.phtml:7
#: modules/default/views/scripts/messageusers/index.phtml:39
msgid "Send"
msgstr "Verstuur"

#: modules/default/views/scripts/history/index.phtml:13
msgid "Clear History"
msgstr "Verwijder geschiedenis"

#: modules/default/views/scripts/index/index.phtml:17
msgid "OPEN AN ACCOUNT NOW"
msgstr "MAAK NU EEN ACCOUNT AAN"

#: modules/default/views/scripts/index/index.phtml:22
msgid "Latest News"
msgstr "Laatste Nieuws"

#: modules/default/views/scripts/messageusers/index.phtml:9
msgid "This message will be sent to all registered Community-ID users"
msgstr "Dit bericht zal aan alle geregistreerde Community-ID gebruikers vezonden worden"

#: modules/default/views/scripts/messageusers/index.phtml:18
msgid "switch to Plain-Text"
msgstr "Schakel over naar platte tekst"

#: modules/default/views/scripts/messageusers/index.phtml:21
msgid "switch to Rich-Text (HTML)"
msgstr "Schakel over naar HTML"

#: modules/default/views/scripts/openid/login.phtml:5
msgid "Login"
msgstr "Log in"

#: modules/default/views/scripts/openid/trust.phtml:3
#, php-format
msgid "A site identifying as %s has asked for confirmation that %s is your identity URL."
msgstr "Een site die zich identificeert als %s heeft gevraagd te bevestigen dat %s jouw identity URL is."

#: modules/default/views/scripts/openid/trust.phtml:9
msgid "It also requests this additional information about you:"
msgstr "De site vroeg ook om de volgende extra informatie over jou:"

#: modules/default/views/scripts/openid/trust.phtml:10
msgid "(Fields are automatically filled according to the personal info stored in your community-id account)"
msgstr "(Velden worden automatisch gevuld op basis van de persoonlijke informatie die is opgeslagen in jouw community-id account)"

#: modules/default/views/scripts/openid/trust.phtml:11
msgid "(fields marked by (*) are required)"
msgstr "(velden met een (*) zijn verplicht)"

#: modules/default/views/scripts/openid/trust.phtml:18
#, php-format
msgid "The private policy can be found at %s"
msgstr "De privacy policy is te vinden op %s"

#: modules/default/views/scripts/openid/trust.phtml:23
msgid "Forever"
msgstr "Altijd"

#: modules/default/views/scripts/openid/trust.phtml:26
msgid "Allow"
msgstr "Sta toe"

#: modules/default/views/scripts/openid/trust.phtml:27
msgid "Deny"
msgstr "Weiger"

#: modules/default/views/scripts/privacy/index.phtml:1
msgid "Privacy Policy"
msgstr "Privacy Policy"

#: modules/default/views/scripts/sites/index.phtml:15
msgid "Information Exchanged"
msgstr "Uitgewisselde informatie"

#: modules/default/views/scripts/sites/index.phtml:17
msgid "Information exchanged with:"
msgstr "Information uitgewisseld met:"

#: modules/default/views/scripts/sites/index.phtml:21
msgid "OK"
msgstr "OK"

#: modules/install/views/scripts/complete/index.phtml:2
msgid "The installation was performed successfully"
msgstr "De installatie is succesvol uitgevoerd"

#: modules/install/views/scripts/complete/index.phtml:10
msgid "Finish"
msgstr "Afmaken"

#: modules/install/views/scripts/credentials/index.phtml:2
msgid "Database and E-mail information"
msgstr "Database en E-mail informatie"

#: modules/install/views/scripts/index/index.phtml:2
msgid "This Community-ID instance hasn't been installed yet"
msgstr "Deze Community-ID instantie is nog niet geinstalleerd"

#: modules/install/views/scripts/index/index.phtml:5
msgid "Proceed with installation"
msgstr "Ga verder met de installatie"

#: modules/install/views/scripts/permissions/index.phtml:2
msgid "Please correct the following problems before proceeding:"
msgstr "Corrigeer de volgende problemen voordat je verder gaat:"

#: modules/install/views/scripts/permissions/index.phtml:10
msgid "Check again"
msgstr "Controleer nogmaals"

#: modules/stats/views/scripts/authorizations/index.phtml:1
msgid "Authorizations per day"
msgstr "Autorisaties per dag"

#: modules/stats/views/scripts/authorizations/index.phtml:3
#: modules/stats/views/scripts/registrations/index.phtml:3
#: modules/stats/views/scripts/sites/index.phtml:3
msgid "Select view"
msgstr "Selecteer weergave"

#: modules/stats/views/scripts/authorizations/index.phtml:5
#: modules/stats/views/scripts/registrations/index.phtml:5
#: modules/stats/views/scripts/sites/index.phtml:5
msgid "Last Week"
msgstr "Vorige week"

#: modules/stats/views/scripts/authorizations/index.phtml:6
#: modules/stats/views/scripts/registrations/index.phtml:7
#: modules/stats/views/scripts/sites/index.phtml:6
msgid "Last Year"
msgstr "Vorig jaar"

#: modules/stats/views/scripts/registrations/index.phtml:1
msgid "Registrations per day"
msgstr "Registraties per dag"

#: modules/stats/views/scripts/registrations/index.phtml:6
msgid "Last Month"
msgstr "Vorige maand"

#: modules/stats/views/scripts/sites/index.phtml:1
msgid "Trusted Sites"
msgstr "vertrouwde sites"

#: modules/stats/views/scripts/top/index.phtml:1
msgid "Top 10 Trusted Sites"
msgstr "Top 10 vertrouwde sites"

#: modules/stats/views/scripts/top/index.phtml:7
#, php-format
msgid "%s users"
msgstr "%s gebruikers"

#: modules/users/views/scripts/login/index.phtml:3
#, php-format
msgid "Hello, %s"
msgstr "Hallo, %s"

#: modules/users/views/scripts/login/index.phtml:7
msgid "Account"
msgstr "Account"

#: modules/users/views/scripts/login/index.phtml:10
msgid "Personal Info"
msgstr "Persoonlijke informatie"

#: modules/users/views/scripts/login/index.phtml:13
msgid "Sites database"
msgstr "Sites database"

#: modules/users/views/scripts/login/index.phtml:16
msgid "History Log"
msgstr "Historisch logs"

#: modules/users/views/scripts/login/index.phtml:19
msgid "Logout"
msgstr "Uitloggen"

#: modules/users/views/scripts/login/index.phtml:24
msgid "Admin options"
msgstr "Beheer options"

#: modules/users/views/scripts/login/index.phtml:27
msgid "Manage Users"
msgstr "Beheer gebruikers"

#: modules/users/views/scripts/login/index.phtml:30
msgid "Message Users"
msgstr "Stuur bericht aan gebruikers"

#: modules/users/views/scripts/login/index.phtml:34
msgid "Disable Maintenance Mode"
msgstr "Schakel onderhoudsmodus uit"

#: modules/users/views/scripts/login/index.phtml:36
msgid "Enable Maintenance Mode"
msgstr "Schakel onderhoudsmodus in"

#: modules/users/views/scripts/login/index.phtml:40
msgid "Statistics"
msgstr "Statistieken"

#: modules/users/views/scripts/login/index.phtml:47
msgid "User access is currently disabled for system maintenance.<br />Please try again later"
msgstr "Gebruikerstoegang is momenteel niet mogelijk in verband met onderhoud.<br />Probeer het later opnieuw"

#: modules/users/views/scripts/login/index.phtml:58
msgid "Remember me"
msgstr "Onthoud mij"

#: modules/users/views/scripts/login/index.phtml:61
msgid "Log in"
msgstr "Log in"

#: modules/users/views/scripts/login/index.phtml:67
msgid "Forgot you password?"
msgstr "Wachtwoord vergeten?"

#: modules/users/views/scripts/login/index.phtml:73
msgid "You don't have an account?"
msgstr "Je hebt geen account?"

#: modules/users/views/scripts/login/index.phtml:75
msgid "REGISTER NOW!"
msgstr "REGISTREER NU!"

#: modules/users/views/scripts/manageusers/index.phtml:11
msgid "All"
msgstr "Allen"

#: modules/users/views/scripts/manageusers/index.phtml:14
msgid "Confirmed"
msgstr "Bevestigd"

#: modules/users/views/scripts/manageusers/index.phtml:17
msgid "Unconfirmed"
msgstr "Onbevestigd"

#: modules/users/views/scripts/manageusers/index.phtml:24
msgid "Total users:"
msgstr "Totaal aantal gebruikers:"

#: modules/users/views/scripts/manageusers/index.phtml:25
msgid "Total confirmed users:"
msgstr "Totaal aantal bevestigde gebruikers:"

#: modules/users/views/scripts/manageusers/index.phtml:26
msgid "Total unconfirmed users:"
msgstr "Totaal aantal onbevestigde gebruikers:"

#: modules/users/views/scripts/manageusers/index.phtml:29
msgid "Add User"
msgstr "Voeg gebruiker toe"

#: modules/users/views/scripts/manageusers/index.phtml:31
msgid "Delete Unconfirmed Users"
msgstr "Verwijder onbevestigde gebruikers"

#: modules/users/views/scripts/personalinfo/edit.phtml:42
msgid "Save"
msgstr "Sla op"

#: modules/users/views/scripts/personalinfo/edit.phtml:43
msgid "Cancel"
msgstr "Cancel"

#: modules/users/views/scripts/personalinfo/index.phtml:16
#: modules/users/views/scripts/profile/index.phtml:17
msgid "Edit"
msgstr "Bewerk"

#: modules/users/views/scripts/personalinfo/index.phtml:22
msgid "This information will be used to automatically populate registration fields to any OpenID transaction that requires so"
msgstr "Deze informatie zal gebruikt worden om automatisch registratievelden te vullen wanneer een OpenID transactie dat vereist"

#: modules/users/views/scripts/personalinfo/show.phtml:8
msgid "Not Entered"
msgstr "Niet ingevuld"

#: modules/users/views/scripts/profile/index.phtml:13
msgid "Account info"
msgstr "Account informatie"

#: modules/users/views/scripts/profile/index.phtml:20
msgid "Change Password"
msgstr "Wijzig wachtwoord"

#: modules/users/views/scripts/profile/index.phtml:38
#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:22
msgid "Delete Account"
msgstr "Verwijder account"

#: modules/users/views/scripts/profilegeneral/accountinfo.phtml:28
msgid "OpenID"
msgstr "Open ID"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:3
msgid "Why do you want to delete your Community-ID account?"
msgstr "Waarom wil jij je Community-ID account verwijderen?"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:4
msgid "Please check all that apply:"
msgstr "Selecteer wat van toepassing is:"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:8
msgid "This was just a test account"
msgstr "Dit was alleen een test account"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:11
msgid "I found a better service"
msgstr "Ik heb een betere service gevonden"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:14
msgid "Service lacked some key features I needed"
msgstr "Aan de service ontbreekt functionaliteit waar ik niet buiten kan"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:17
msgid "No particular reason"
msgstr "Geen specifieke reden"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:20
msgid "Additional comments:"
msgstr "Aanvullende reakties:"

#: modules/users/views/scripts/recoverpassword/index.phtml:1
msgid "Please enter your E-mail below to receive a link to reset your password"
msgstr "Vul hieronder je E-mail adres in om een link te ontvangen voor het resetten van je wachtwoord"

#: modules/users/views/scripts/register/index.phtml:1
msgid "Registration Form"
msgstr "Registratieformulier"

#: views/layouts/layout.phtml:32
msgid "Home"
msgstr "Home"

#: views/layouts/layout.phtml:35
msgid "Feedback"
msgstr "Feedback"

#: views/layouts/layout.phtml:52
msgid "Maintenance mode is enabled: user access is restricted"
msgstr "Onderhoudsmodus is actief: gebruikerstoegang is beperkt"

#~ msgid "Username:"
#~ msgstr "Gebruikersnaam:"
#~ msgid "E-mail:"
#~ msgstr "E-mail:"
#~ msgid ""
#~ "Fed up with having to remember dozens of<br />usernames and passwords<br /"
#~ ">for your favorite websites?"
#~ msgstr ""
#~ "Heb je er genoeg van om <br />gebruikersnamen en wachtwoorden<br />voor "
#~ "je favoriete websites te moeten onthouden?"
#~ msgid "Starting today<br />you'll only have to remember one"
#~ msgstr "Vanaf vandaag<br />hoef je er nog maar één te onthouden"
#~ msgid "Help and Support"
#~ msgstr "Help en Support"
#~ msgid "Privacy"
#~ msgstr "Privacy"
#~ msgid "About Us"
#~ msgstr "Over ons"
#~ msgid "Contact Us"
#~ msgstr "Neem contact op"
#~ msgid "LOGIN"
#~ msgstr "LOGIN"
#~ msgid "LOG IN"
#~ msgstr "LOG IN"

BIN
languages/pl/lang.mo Normal file

Binary file not shown.

774
languages/pl/lang.po Normal file
View File

@ -0,0 +1,774 @@
msgid ""
msgstr ""
"Project-Id-Version: Community-ID English translation\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-12 07:57-0500\n"
"PO-Revision-Date: 2009-05-12 20:31+0100\n"
"Last-Translator: Piotr Baranowski <piotr.baranowski@zeno.pl>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: English\n"
"X-Poedit-KeywordsList: translate\n"
"X-Poedit-Basepath: ../../\n"
"X-Poedit-SearchPath-0: modules\n"
"X-Poedit-SearchPath-1: views\n"
"X-Poedit-SearchPath-2: webdir/javascript\n"

#: modules/default/models/Fields.php:32
msgid "Nickname"
msgstr "Ksywka"

#: modules/default/models/Fields.php:33
#: modules/users/forms/AccountInfoForm.php:40
#: modules/users/forms/RegisterForm.php:36
#: modules/users/views/scripts/profilegeneral/accountinfo.phtml:20
msgid "E-mail"
msgstr "E-mail"

#: modules/default/models/Fields.php:34
msgid "Full Name"
msgstr "Imię i nazwisko"

#: modules/default/models/Fields.php:35
msgid "Date of Birth"
msgstr "Data urodzenia"

#: modules/default/models/Fields.php:36
msgid "Gender"
msgstr "Płeć"

#: modules/default/models/Fields.php:37
msgid "Postal Code"
msgstr "Kod pocztowy"

#: modules/default/models/Fields.php:38
msgid "Country"
msgstr "Kraj"

#: modules/default/models/Fields.php:39
msgid "Language"
msgstr "Język"

#: modules/default/models/Fields.php:40
msgid "Time Zone"
msgstr "Strefa czasowa"

#: modules/default/models/Field.php:39
msgid "Male"
msgstr "Mężczyzna"

#: modules/default/models/Field.php:40
msgid "Female"
msgstr "Kobieta"

#: modules/default/controllers/IndexController.php:27
msgid "Could not retrieve news items"
msgstr "Nie mogę wczytać nowych newsów"

#: modules/default/controllers/IndexController.php:42
msgid "Read More"
msgstr "Czytaj więcej"

#: modules/default/controllers/MessageusersController.php:46
msgid "CC field must be a comma-separated list of valid E-mails"
msgstr "Pole CC musi być wypełnione wartościami oddzielonymi przecinkiem"

#: modules/default/forms/OpenidLoginForm.php:17
#: modules/users/forms/AccountInfoForm.php:26
#: modules/users/forms/RegisterForm.php:43
#: modules/users/views/scripts/profilegeneral/accountinfo.phtml:4
msgid "Username"
msgstr "Login"

#: modules/default/forms/OpenidLoginForm.php:22
msgid "Password"
msgstr "Hasło"

#: modules/default/forms/MessageUsersForm.php:17
msgid "Subject:"
msgstr "Tytuł:"

#: modules/default/forms/MessageUsersForm.php:22
msgid "CC:"
msgstr "CC:"

#: modules/default/forms/MessageUsersForm.php:26
#: modules/default/views/scripts/messageusers/index.phtml:26
#: modules/default/views/scripts/messageusers/index.phtml:32
msgid "Body:"
msgstr "Treść:"

#: modules/default/forms/FeedbackForm.php:25
msgid "Enter your name"
msgstr "Wpisz swoje imię"

#: modules/default/forms/FeedbackForm.php:30
msgid "Enter your E-mail"
msgstr "Wpisz swój E-mail"

#: modules/default/forms/FeedbackForm.php:37
msgid "Enter your questions or comments"
msgstr "Wpisz swoje pytania i komentarze"

#: modules/default/forms/FeedbackForm.php:44
#: modules/users/forms/RegisterForm.php:59
msgid "Please enter the text below"
msgstr "Wpisz tekst podany poniżej"

#: modules/default/forms/ErrorMessages.php:20
msgid "Value is empty, but a non-empty value is required"
msgstr "Wartość nie może być niepusta"

#: modules/default/forms/ErrorMessages.php:21
msgid "'%value%' is not a valid email address in the basic format local-part@hostname"
msgstr "'%value%' nie jest prawidłowym adresem E-mail"

#: modules/default/forms/ErrorMessages.php:22
msgid "Captcha value is wrong"
msgstr "Wartość z captcha jest nieprawidłowa"

#: modules/default/forms/ErrorMessages.php:23
msgid "Password confirmation does not match"
msgstr "Potwierdzenie hasła nie jest równe hasłu"

#: modules/stats/controllers/SitesController.php:68
msgid "Trusted sites"
msgstr "Zaufane strony"

#: modules/stats/controllers/SitesController.php:75
msgid "Sites per user"
msgstr "Liczba stron na użytkownika"

#: modules/install/controllers/CredentialsController.php:185
#, php-format
msgid "The directory where Community-ID is installed must be writable by the web server user (%s). Another option is to create an EMPTY config.php file that is writable by that user."
msgstr "Katalog instalacyjny Community-ID musi być zapisywalny przez użytkownika serwera (%s). Inną możliwością jest stworzenie pustego pliku config.php który może byż zapisywany przez tego użytkownika."

#: modules/install/controllers/CredentialsController.php:188
#, php-format
msgid "The directory \"captchas\" under the web directory for Community-ID must be writable by the web server user (%s)"
msgstr "Katalog \"captchas\" w katalogu webdir musi być zapisywalny przez użytkownika serwera WWW (%s)"

#: modules/users/controllers/UserslistController.php:50
msgid "admin"
msgstr "admin"

#: modules/users/controllers/UserslistController.php:52
msgid "confirmed"
msgstr "potwierdzony"

#: modules/users/controllers/UserslistController.php:54
msgid "unconfirmed"
msgstr "niepotwierdzony"

#: modules/users/controllers/ProfilegeneralController.php:76
#: modules/users/controllers/RegisterController.php:59
msgid "This username is already in use"
msgstr "Ten login jest już zajęty"

#: modules/users/controllers/ProfilegeneralController.php:85
#: modules/users/controllers/RegisterController.php:66
msgid "This E-mail is already in use"
msgstr "Ten adres E-mail jest już zajęty"

#: modules/users/controllers/ProfilegeneralController.php:243
msgid "Your acccount has been successfully deleted"
msgstr "Twoje konto zostało skasowane"

#: modules/users/controllers/RegisterController.php:26
msgid "Sorry, registrations are currently disabled"
msgstr "Wybacz, rejestracja jest aktualnie niemożliwa"

#: modules/users/controllers/ManageusersController.php:25
msgid "User has been deleted successfully"
msgstr "Użytkownik został skasowany"

#: modules/users/forms/AccountInfoForm.php:30
#: modules/users/forms/RegisterForm.php:26
msgid "First Name"
msgstr "Imię"

#: modules/users/forms/AccountInfoForm.php:35
#: modules/users/forms/RegisterForm.php:31
msgid "Last Name"
msgstr "Nazwisko"

#: modules/users/forms/AccountInfoForm.php:50
#: modules/users/forms/ChangePasswordForm.php:18
msgid "Enter password"
msgstr "Wpisz hasło"

#: modules/users/forms/AccountInfoForm.php:56
#: modules/users/forms/RegisterForm.php:54
#: modules/users/forms/ChangePasswordForm.php:24
msgid "Enter password again"
msgstr "Wpisz hasło ponownie"

#: modules/users/forms/LoginForm.php:8
msgid "USERNAME"
msgstr "LOGIN"

#: modules/users/forms/LoginForm.php:13
msgid "PASSWORD"
msgstr "HASŁO"

#: modules/users/forms/RegisterForm.php:48
msgid "Enter desired password"
msgstr "Wpisz hasło"

#: webdir/javascript/language.php:30
#: modules/users/views/scripts/profilegeneral/accountinfo.phtml:12
msgid "Name"
msgstr "Imię"

#: webdir/javascript/language.php:31
msgid "Registration"
msgstr "Rejestracja"

#: webdir/javascript/language.php:32
msgid "Status"
msgstr "Status"

#: webdir/javascript/language.php:33
msgid "profile"
msgstr "profil"

#: webdir/javascript/language.php:34
msgid "delete"
msgstr "skasuj"

#: webdir/javascript/language.php:35
msgid "Site"
msgstr "Strona"

#: webdir/javascript/language.php:36
msgid "view info exchanged"
msgstr "view info exchanged"

#: webdir/javascript/language.php:37
msgid "deny"
msgstr "zabroń"

#: webdir/javascript/language.php:38
msgid "allow"
msgstr "zezwól"

#: webdir/javascript/language.php:39
msgid "Are you sure you wish to send this message to ALL users?"
msgstr "Czy jesteś pewien, że chcesz wysłać tą wiadomość do wszystkich użytkowników?"

#: webdir/javascript/language.php:40
msgid "Are you sure you wish to deny trust to this site?"
msgstr "Czy jesteś pewien, że chcesz zabronić dostępu do tej strony?"

#: webdir/javascript/language.php:41
msgid "operation failed"
msgstr "operacja nie powiodła się"

#: webdir/javascript/language.php:42
msgid "Trust to the following site has been granted:"
msgstr "Zezwoliłeś na dostęp do tej strony:"

#: webdir/javascript/language.php:43
msgid "Trust the following site has been denied:"
msgstr "Zabroniłeś dostępu do tej strony:"

#: webdir/javascript/language.php:44
msgid "ERROR. The server returned:"
msgstr "BŁĄD. Serwer zwrócił:"

#: webdir/javascript/language.php:45
msgid "Your relationship with the following site has been deleted:"
msgstr "Twój związek z poniższą stroną został skasowany:"

#: webdir/javascript/language.php:46
msgid "The history log has been cleared"
msgstr "Historia została wyczyszczona"

#: webdir/javascript/language.php:47
msgid "Are you sure you wish to allow access to this site?"
msgstr "Jesteś pewien, że chcesz dać dostep do tej strony?"

#: webdir/javascript/language.php:48
msgid "Are you sure you wish to delete your relationship with this site?"
msgstr "Jesteś pewien, że chcesz skasować związek z tą stroną?"

#: webdir/javascript/language.php:49
msgid "Are you sure you wish to delete all the History Log?"
msgstr "Jesteś pewien, że chcesz wyczyścić log historii?"

#: webdir/javascript/language.php:50
msgid "Are you sure you wish to delete the user"
msgstr "Jesteś pewien, że chcesz skasować użytkownika"

#: webdir/javascript/language.php:51
msgid "Are you sure you wish to delete all the unconfirmed accounts?"
msgstr "Czy jesteś pewien, że chcesz skasować wszystkie nieaktywowane konta?"

#: webdir/javascript/language.php:52
msgid "Date"
msgstr "Data"

#: webdir/javascript/language.php:53
msgid "Result"
msgstr "Wynik"

#: webdir/javascript/language.php:54
msgid "No records found."
msgstr "Brak rekordów."

#: webdir/javascript/language.php:55
msgid "Loading..."
msgstr "Wczytywanie..."

#: webdir/javascript/language.php:56
msgid "Data error."
msgstr "Błąd danych."

#: webdir/javascript/language.php:57
msgid "Click to sort ascending"
msgstr "Kliknij aby sortować rosnąco"

#: webdir/javascript/language.php:58
msgid "Click to sort descending"
msgstr "Kliknij aby sortować malejąco"

#: webdir/javascript/language.php:59
msgid "Authorized"
msgstr "Autoryzowany"

#: webdir/javascript/language.php:60
msgid "Denied"
msgstr "Zabroniony"

#: webdir/javascript/language.php:61
msgid "of"
msgstr "z"

#: webdir/javascript/language.php:62
msgid "next"
msgstr "następny"

#: webdir/javascript/language.php:63
msgid "prev"
msgstr "poprzedni"

#: webdir/javascript/language.php:64
msgid "IP"
msgstr "IP"

#: modules/default/views/scripts/privacy/index.phtml:1
msgid "Privacy Policy"
msgstr "Polityka Prywatności"

#: modules/default/views/scripts/messageusers/index.phtml:9
msgid "This message will be sent to all registered Community-ID users"
msgstr "Ta wiadomość zostanie wysłana do wszystkich zarejestrowanych użytkowników"

#: modules/default/views/scripts/messageusers/index.phtml:18
msgid "switch to Plain-Text"
msgstr "przełącz na Plain-Text"

#: modules/default/views/scripts/messageusers/index.phtml:21
msgid "switch to Rich-Text (HTML)"
msgstr "przełącz na Rich-Text (HTML)"

#: modules/default/views/scripts/messageusers/index.phtml:39
#: modules/default/views/scripts/feedback/index.phtml:7
#: modules/install/views/scripts/credentials/index.phtml:12
#: modules/users/views/scripts/register/index.phtml:10
#: modules/users/views/scripts/recoverpassword/index.phtml:4
msgid "Send"
msgstr "Wyślij"

#: modules/default/views/scripts/feedback/index.phtml:1
msgid "In order to serve you better, we have provided the form below for your questions and comments"
msgstr "Aby lepiej świadczyć nasze usługi, udostępniliśmy formularz poniżej na Twoje pytania i komentarze"

#: modules/default/views/scripts/openid/trust.phtml:3
#, php-format
msgid "A site identifying as %s has asked for confirmation that %s is your identity URL."
msgstr "Strona przedstawiająca się jako %s pyta o potwierdzenie, że %s to Twoj identyfikator URL."

#: modules/default/views/scripts/openid/trust.phtml:9
msgid "It also requests this additional information about you:"
msgstr "Pyta również o te dodatkowe informacje o Tobie:"

#: modules/default/views/scripts/openid/trust.phtml:10
msgid "(Fields are automatically filled according to the personal info stored in your community-id account)"
msgstr "(Pola są automatycznie wypełniane zgodnie z Twoimi danymi zapisanymi na koncie)"

#: modules/default/views/scripts/openid/trust.phtml:11
msgid "(fields marked by (*) are required)"
msgstr "(pola oznaczone przez (*) są wymagane)"

#: modules/default/views/scripts/openid/trust.phtml:18
#, php-format
msgid "The private policy can be found at %s"
msgstr "Polityka prywatności może być znaleziona pod adresem %s"

#: modules/default/views/scripts/openid/trust.phtml:23
msgid "Forever"
msgstr "Na zawsze"

#: modules/default/views/scripts/openid/trust.phtml:26
msgid "Allow"
msgstr "Zezwól"

#: modules/default/views/scripts/openid/trust.phtml:27
msgid "Deny"
msgstr "Zabroń"

#: modules/default/views/scripts/openid/login.phtml:5
msgid "Login"
msgstr "Login"

#: modules/default/views/scripts/index/index.phtml:17
msgid "OPEN AN ACCOUNT NOW"
msgstr "STWÓRZ SWOJE KONTO TERAZ"

#: modules/default/views/scripts/index/index.phtml:22
msgid "Latest News"
msgstr "Najnowsze wiadomości"

#: modules/default/views/scripts/sites/index.phtml:15
msgid "Information Exchanged"
msgstr "Informacje wymienione"

#: modules/default/views/scripts/sites/index.phtml:17
msgid "Information exchanged with:"
msgstr "Informacje wymienione z:"

#: modules/default/views/scripts/sites/index.phtml:21
msgid "OK"
msgstr "OK"

#: modules/default/views/scripts/history/index.phtml:13
msgid "Clear History"
msgstr "Wyczyść Historię"

#: modules/default/views/scripts_monkeys/index/subheader.phtml:3
msgid "Fed up with having to remember dozens of<br />usernames and passwords<br />for your favorite websites?"
msgstr "Masz dość przymusu pamiętania tony<br />loginów i haseł<br />do Twoich ulubionych stron internetowych?"

#: modules/default/views/scripts_monkeys/index/subheader.phtml:4
msgid "Starting today<br />you'll only have to remember one"
msgstr "Od dzisiaj<br/>będziesz potrzebował tylko jednego"

#: modules/stats/views/scripts/authorizations/index.phtml:1
msgid "Authorizations per day"
msgstr "Liczba autoryzacji na dzień"

#: modules/stats/views/scripts/authorizations/index.phtml:3
#: modules/stats/views/scripts/registrations/index.phtml:3
#: modules/stats/views/scripts/sites/index.phtml:3
msgid "Select view"
msgstr "Wybierz widok"

#: modules/stats/views/scripts/authorizations/index.phtml:5
#: modules/stats/views/scripts/registrations/index.phtml:5
#: modules/stats/views/scripts/sites/index.phtml:5
msgid "Last Week"
msgstr "Ostatni tydzień"

#: modules/stats/views/scripts/authorizations/index.phtml:6
#: modules/stats/views/scripts/registrations/index.phtml:7
#: modules/stats/views/scripts/sites/index.phtml:6
msgid "Last Year"
msgstr "Ostatni rok"

#: modules/stats/views/scripts/registrations/index.phtml:1
msgid "Registrations per day"
msgstr "Liczba rejestracji na dzień"

#: modules/stats/views/scripts/registrations/index.phtml:6
msgid "Last Month"
msgstr "Ostatni miesiąc"

#: modules/stats/views/scripts/top/index.phtml:1
msgid "Top 10 Trusted Sites"
msgstr "10 najczęściej zezwalanych stron"

#: modules/stats/views/scripts/top/index.phtml:7
#, php-format
msgid "%s users"
msgstr "%s użytkowników"

#: modules/stats/views/scripts/sites/index.phtml:1
msgid "Trusted Sites"
msgstr "Zaufane strony"

#: modules/install/views/scripts/complete/index.phtml:2
msgid "The installation was performed successfully"
msgstr "Instalacja powiodła się"

#: modules/install/views/scripts/complete/index.phtml:10
msgid "Finish"
msgstr "Zakończ"

#: modules/install/views/scripts/permissions/index.phtml:2
msgid "Please correct the following problems before proceeding:"
msgstr "Popraw poniższe problemy zanim przejdziesz dalej:"

#: modules/install/views/scripts/permissions/index.phtml:10
msgid "Check again"
msgstr "Sprawdź ponownie"

#: modules/install/views/scripts/credentials/index.phtml:2
msgid "Database and E-mail information"
msgstr "Potwierdzenie bazy danych i E-maila"

#: modules/install/views/scripts/index/index.phtml:2
msgid "This Community-ID instance hasn't been installed yet"
msgstr "Ta instalacja Community-ID nie jest jeszcze zakończona"

#: modules/install/views/scripts/index/index.phtml:5
msgid "Proceed with installation"
msgstr "Kontynuuj instalację"

#: modules/users/views/scripts/register/index.phtml:1
msgid "Registration Form"
msgstr "Formularz rejestracyjny"

#: modules/users/views/scripts/personalinfo/edit.phtml:42
#: modules/users/views/scripts/profilegeneral/editaccountinfo.phtml:13
#: modules/users/views/scripts/profilegeneral/changepassword.phtml:36
msgid "Save"
msgstr "Zapisz"

#: modules/users/views/scripts/personalinfo/edit.phtml:43
#: modules/users/views/scripts/profilegeneral/editaccountinfo.phtml:14
#: modules/users/views/scripts/profilegeneral/changepassword.phtml:37
#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:23
msgid "Cancel"
msgstr "Anuluj"

#: modules/users/views/scripts/personalinfo/show.phtml:8
msgid "Not Entered"
msgstr "Nie wpisane"

#: modules/users/views/scripts/personalinfo/index.phtml:13
#: modules/users/views/scripts/login/index.phtml:10
#: modules/users/views/scripts_monkeys/login/index.phtml:10
msgid "Personal Info"
msgstr "Informacje osobiste"

#: modules/users/views/scripts/personalinfo/index.phtml:16
#: modules/users/views/scripts/profile/index.phtml:17
msgid "Edit"
msgstr "Edycja"

#: modules/users/views/scripts/personalinfo/index.phtml:22
msgid "This information will be used to automatically populate registration fields to any OpenID transaction that requires so"
msgstr "Te informacje zostaną automatycznie użyte aby wypełnić pola rejestracyjne dla każdego serwera OpenID która tego zarząda"

#: modules/users/views/scripts/recoverpassword/index.phtml:1
msgid "Please enter your E-mail below to receive a link to reset your password"
msgstr "Wpisz poniżej swój E-mail aby otrzymać link do przypomnienia hasła"

#: modules/users/views/scripts/profile/index.phtml:13
msgid "Account info"
msgstr "Informacje o koncie"

#: modules/users/views/scripts/profile/index.phtml:20
msgid "Change Password"
msgstr "Zmień hasło"

#: modules/users/views/scripts/profile/index.phtml:38
#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:22
msgid "Delete Account"
msgstr "Skasuj konto"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:3
msgid "Why do you want to delete your Community-ID account?"
msgstr "Czemu chcesz skasować swoje konto?"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:4
msgid "Please check all that apply:"
msgstr "Zaznacz wszystkie które pasują:"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:8
msgid "This was just a test account"
msgstr "To było konto testowe"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:11
msgid "I found a better service"
msgstr "Znalazłem lepszy serwer"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:14
msgid "Service lacked some key features I needed"
msgstr "Brakowało mi niektórych funkcjonalności"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:17
msgid "No particular reason"
msgstr "Bez powodu"

#: modules/users/views/scripts/profilegeneral/confirmdelete.phtml:20
msgid "Additional comments:"
msgstr "Dodatkowe komentarze:"

#: modules/users/views/scripts/profilegeneral/accountinfo.phtml:28
#, fuzzy
msgid "OpenID"
msgstr "Open ID"

#: modules/users/views/scripts/login/index.phtml:3
#: modules/users/views/scripts_monkeys/login/index.phtml:3
#, php-format
msgid "Hello, %s"
msgstr "Witaj, %s"

#: modules/users/views/scripts/login/index.phtml:7
#: modules/users/views/scripts_monkeys/login/index.phtml:7
msgid "Account"
msgstr "Konto"

#: modules/users/views/scripts/login/index.phtml:13
#: modules/users/views/scripts_monkeys/login/index.phtml:13
msgid "Sites database"
msgstr "Baza stron"

#: modules/users/views/scripts/login/index.phtml:16
#: modules/users/views/scripts_monkeys/login/index.phtml:16
msgid "History Log"
msgstr "Historia"

#: modules/users/views/scripts/login/index.phtml:19
#: modules/users/views/scripts_monkeys/login/index.phtml:19
msgid "Logout"
msgstr "Wyloguj"

#: modules/users/views/scripts/login/index.phtml:24
#: modules/users/views/scripts_monkeys/login/index.phtml:24
msgid "Admin options"
msgstr "Opcje admina"

#: modules/users/views/scripts/login/index.phtml:27
#: modules/users/views/scripts_monkeys/login/index.phtml:27
msgid "Manage Users"
msgstr "Zarządzaj Użytkownikami"

#: modules/users/views/scripts/login/index.phtml:30
#: modules/users/views/scripts_monkeys/login/index.phtml:30
msgid "Message Users"
msgstr "Wiadomości dla Użytkowników"

#: modules/users/views/scripts/login/index.phtml:34
#: modules/users/views/scripts_monkeys/login/index.phtml:34
msgid "Disable Maintenance Mode"
msgstr "Wyłącz tryb konserwacji"

#: modules/users/views/scripts/login/index.phtml:36
#: modules/users/views/scripts_monkeys/login/index.phtml:36
msgid "Enable Maintenance Mode"
msgstr "Włącz tryb konserwacji"

#: modules/users/views/scripts/login/index.phtml:40
#: modules/users/views/scripts_monkeys/login/index.phtml:40
msgid "Statistics"
msgstr "Statystyki"

#: modules/users/views/scripts/login/index.phtml:47
#: modules/users/views/scripts_monkeys/login/index.phtml:50
msgid "User access is currently disabled for system maintenance.<br />Please try again later"
msgstr "Dostęp dla użytkowników jest aktualnie zabroniony, gdyż system jest w trybie konserwacji.<br/>Spróbuj ponownie później."

#: modules/users/views/scripts/login/index.phtml:58
#: modules/users/views/scripts_monkeys/login/index.phtml:61
msgid "Remember me"
msgstr "Zapamiętaj mnie"

#: modules/users/views/scripts/login/index.phtml:61
#: modules/users/views/scripts_monkeys/login/index.phtml:64
msgid "Log in"
msgstr "Zaloguj"

#: modules/users/views/scripts/login/index.phtml:67
#: modules/users/views/scripts_monkeys/login/index.phtml:70
msgid "Forgot you password?"
msgstr "Zapomniałeś hasła?"

#: modules/users/views/scripts/login/index.phtml:73
#: modules/users/views/scripts_monkeys/login/index.phtml:76
msgid "You don't have an account?"
msgstr "Nie masz konta?"

#: modules/users/views/scripts/login/index.phtml:75
#: modules/users/views/scripts_monkeys/login/index.phtml:78
msgid "REGISTER NOW!"
msgstr "ZAREJESTRUJ SIĘ!"

#: modules/users/views/scripts/manageusers/index.phtml:11
msgid "All"
msgstr "Wszystko"

#: modules/users/views/scripts/manageusers/index.phtml:14
msgid "Confirmed"
msgstr "Potwierdzone"

#: modules/users/views/scripts/manageusers/index.phtml:17
msgid "Unconfirmed"
msgstr "Niepotwierdzone"

#: modules/users/views/scripts/manageusers/index.phtml:24
msgid "Total users:"
msgstr "Liczba użytkowników:"

#: modules/users/views/scripts/manageusers/index.phtml:25
msgid "Total confirmed users:"
msgstr "Liczba potwierdzonych użytkowników:"

#: modules/users/views/scripts/manageusers/index.phtml:26
msgid "Total unconfirmed users:"
msgstr "Liczba niepotwierdzonych użytkowników:"

#: modules/users/views/scripts/manageusers/index.phtml:29
msgid "Add User"
msgstr "Dodaj użytkownika"

#: modules/users/views/scripts/manageusers/index.phtml:31
msgid "Delete Unconfirmed Users"
msgstr "Skasuj nieaktywnych użytkowników"

#: views/layouts_monkeys/layout.phtml:32
#: views/layouts/layout.phtml:32
msgid "Home"
msgstr "Strona główna"

#: views/layouts_monkeys/layout.phtml:35
#: views/layouts/layout.phtml:35
msgid "Feedback"
msgstr "Opinie"

#: views/layouts_monkeys/layout.phtml:38
msgid "Help and Support"
msgstr "Pomoc i wsparcie"

#: views/layouts_monkeys/layout.phtml:55
#: views/layouts/layout.phtml:52
msgid "Maintenance mode is enabled: user access is restricted"
msgstr "Tryb konserwacji jest włączony: dostęp dla użytkowników jest zabroniony"

#: views/layouts_monkeys/layout.phtml:75
msgid "Privacy"
msgstr "Prywatność"

#: views/layouts_monkeys/layout.phtml:78
msgid "About Us"
msgstr "O nas"

#: views/layouts_monkeys/layout.phtml:81
msgid "Contact Us"
msgstr "Skontaktuj się"

#~ msgid "Username:"
#~ msgstr "Username:"
#~ msgid "E-mail:"
#~ msgstr "E-mail:"
#~ msgid "LOGIN"
#~ msgstr "LOGIN"
#~ msgid "LOG IN"
#~ msgstr "LOG IN"

5
libs/MODIFICATIONS.txt Normal file
View File

@ -0,0 +1,5 @@
Modifications to the jpgraph lib:
- this is just the src directory
- copied the README, VERSION and QPL.txt files
- removed the Examples dir
- removed the flags* files

View File

@ -0,0 +1,18 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD Licensese
* @author Keyboard Monkeys Ltd.
* @since Textroller 0.9
* @package TextRoller
* @packager Keyboard Monkeys
*/

class Monkeys_AccessDeniedException extends Zend_Exception
{
public function __construct()
{
parent::__construct('Access Denied');
}
}

View File

@ -0,0 +1,19 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD Licensese
* @author Keyboard Monkeys Ltd.
* @since Textroller 0.9
* @package TextRoller
* @packager Keyboard Monkeys
*/

class Monkeys_BadUrlException extends Zend_Exception
{
public function __construct($url)
{
parent::__construct("Bad URL: $url");
}
}

View File

@ -0,0 +1,104 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

/**
* Same as Zend_Captcha_Image, but also readable by humans ;)
*/
class Monkeys_Captcha_Image extends Zend_Captcha_Image
{
/**#@+
* All uppercase, and removed letters/numbers than can be mistaken for one another
*/
static $V = array("A", "E", "I", "U", "Y");
static $VN = array("A", "E", "I", "U", "Y", "3","4","5","6","7","8","9");
static $C = array("B","C","D","F","G","H","J","K","M","N","P","Q","R","S","T","W","X");
static $CN = array("B","C","D","F","G","H","J","K","M","N","P","Q","R","S","T","W","X","3","4","5","6","7","8","9");
/**#@-*/

/**#@+
* Reduced these levels
*/
protected $_dotNoiseLevel = 25;
protected $_lineNoiseLevel = 1;
/**#@-*/

/**
* Gotta reproduce this function here 'cause PHP won't have late static binding till 5.3
*/
protected function _generateWord()
{
$word = '';
$wordLen = $this->getWordLen();
$vowels = $this->_useNumbers ? self::$VN : self::$V;
$consonants = $this->_useNumbers ? self::$CN : self::$C;

for ($i=0; $i < $wordLen; $i = $i + 2) {
// generate word with mix of vowels and consonants
$consonant = $consonants[array_rand($consonants)];
$vowel = $vowels[array_rand($vowels)];
$word .= $consonant . $vowel;
}

if (strlen($word) > $wordLen) {
$word = substr($word, 0, $wordLen);
}

return $word;
}

/**
* Set captcha word
*
* @param string $word
* @return Zend_Captcha_Word
*/
protected function _setWord($word)
{
$word = strtoupper($word);
$session = $this->getSession();
$session->word = $word;
$this->_word = $word;
return $this;
}

/**
* Validate the word
*
* Overriden to handle on in uppercase for better readability
*
* @see Zend_Validate_Interface::isValid()
* @param mixed $value
* @return boolean
*/
public function isValid($value, $context = null)
{
$name = $this->getName();
if (!isset($context[$name]['input'])) {
$this->_error(self::MISSING_VALUE);
return false;
}
$value = strtoupper($context[$name]['input']);
$this->_setValue($value);

if (!isset($context[$name]['id'])) {
$this->_error(self::MISSING_ID);
return false;
}

$this->_id = $context[$name]['id'];
if ($value !== $this->getWord()) {
$this->_error(self::BAD_CAPTCHA);
return false;
}

return true;
}
}

View File

@ -0,0 +1,163 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

abstract class Monkeys_Controller_Action extends Zend_Controller_Action
{
/**
* not prepended with "_" because their view counterparts can't have "_" prepended
*/
protected $user;
protected $targetUser;

protected $_config;
protected $_numCols = 2;
protected $underMaintenance = false;

public function init()
{
if (!Zend_Registry::isRegistered('user')) {
// guest user
$users = new Users();
$user = $users->createRow();
Zend_Registry::set('user', $user);
}

$this->_config = Zend_Registry::get('config');

$this->user = Zend_Registry::get('user');
$this->view->user = $this->user;

$this->_validateTargetUser();
$this->_checkMaintenanceMode();

$this->view->controller = $this;

$this->view->addHelperPath('libs/Monkeys/View/Helper', 'Monkeys_View_Helper');
$this->_setScriptPaths();
$this->_setBase();
$this->view->numCols = $this->_numCols;

if ($this->getRequest()->isXmlHttpRequest()) {
$slowdown = $this->_config->environment->ajax_slowdown;
if ($slowdown > 0) {
sleep($slowdown);
}
$this->_helper->layout->disableLayout();
} else {
$this->view->version = Setup::VERSION;
$this->view->messages = $this->_helper->FlashMessenger->getMessages();
$this->view->loaderCombine = $this->_config->environment->YDN? 'true' : 'false';
$this->view->loaderBase = $this->_config->environment->YDN?
'http://yui.yahooapis.com/2.6.0/build/'
: $this->view->base . '/javascript/yui/';
}
}

private function _setScriptPaths()
{
if (($template = $this->_config->environment->template) == 'default') {
return;
}

$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
$view = $viewRenderer->view;
$scriptPaths = $view->getScriptPaths();
$oldPath = $scriptPaths[0];
$newPath = substr($oldPath, 0, strrpos($oldPath, DIRECTORY_SEPARATOR, -2) + 1) . "scripts_$template" . DIRECTORY_SEPARATOR;
$view->addScriptPath($newPath);
}

private function _setBase()
{
if ($this->_config->subdomain->enabled) {
$protocol = $this->_getProtocol();

$this->view->base = "$protocol://"
. ($this->_config->subdomain->use_www? 'www.' : '')
. $this->_config->subdomain->hostname;
} else {
$this->view->base = $this->view->getBase();
}
}

private function _validateTargetUser()
{
if (Zend_Registry::isRegistered('targetUser')) {
// used by unit tests to inject the target user
$this->targetUser = Zend_Registry::get('targetUser');
} else {
$userId = $this->_getParam('userid');

if (is_null($userId)) {
$this->targetUser = $this->user;
} elseif ($this->_getParam('userid') == 0) {
$users = new Users();
$this->targetUser = $users->createRow();
} else {
if ($userId != $this->user->id && $this->user->role != User::ROLE_ADMIN) {
$this->_helper->FlashMessenger->addMessage('Error: Invalid user id');
$this->_redirect('profile/edit');
}
$users = new Users();
$this->targetUser = $users->getRowInstance($userId);
}
}

$this->view->targetUser = $this->targetUser;
}

protected function _checkMaintenanceMode()
{
if (!$this->_config->environment->installed) {
$this->underMaintenance = true;
$this->view->underMaintenance = false;
return;
}

$settings = new Settings();
$this->underMaintenance = $settings->isMaintenanceMode();
$this->view->underMaintenance = $this->underMaintenance;
}

protected function _redirectToNormalConnection()
{
if ($this->_config->SSL->enable_mixed_mode) {
$this->_redirect('http://' . $_SERVER['HTTP_HOST'] . $this->view->base);
} else {
$this->_redirect('');
}
}

protected function _redirectForMaintenance($backToNormalConnection = false)
{
if ($backToNormalConnection) {
$this->_redirectToNormalConnection('');
} else {
$this->_redirect('');
}
}

protected function _redirect($url, $options = array())
{
Zend_Registry::get('logger')->log("redirected to '$url'", Zend_Log::DEBUG);

return parent::_redirect($url, $options);
}

protected function _getProtocol()
{
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
return 'https';
} else {
return 'http';
}
}
}

View File

@ -0,0 +1,118 @@
<?

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

abstract class Monkeys_Controller_Error extends Monkeys_Controller_Action
{
protected $_numCols = 1;

public function errorAction()
{
$errors = $this->_getParam('error_handler');

if (!$this->_config->environment->production) {
echo "<br /><br />";
Zend_Debug::Dump($errors);
}

$exceptionClass = get_class($errors->exception);

Zend_Registry::get('logger')->log(
"Exception $exceptionClass\nMessage: ".$errors->exception->getMessage()."\nStack: \n" . print_r($errors->exception->getTraceAsString(), true),
Zend_Log::ERR
);

switch ($exceptionClass) {
case 'Monkeys_BadUrlException';
$this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found');

$this->view->message = 'The URL you entered is incorrect. Please correct and try again.';
break;
case 'Monkeys_AccessDeniedException';
$this->getResponse()->setRawHeader('HTTP/1.1 401 Unauthorized');
$this->view->message = 'Access Denied - Maybe your session has expired? Try logging-in again.';
break;
default:
$this->view->message = get_class($errors->exception) . '<br />' . $errors->exception->getMessage();
if (!$this->_config->environment->production) {
$this->view->trace = $errors->exception->getTraceAsString();
} else if ($this->_config->email->adminemail) {
$mail = self::getMail($errors->exception, $this->user, $errors);
$mail->send();
$this->view->message .= '<br />The system administrator has been notified.';
}
break;
}

$this->getResponse()->clearBody();
}

/**
* @return Zend_Mail
* @throws Zend_Mail_Protocol_Exception
*/
public static function getMail(Exception $ex, User $user, $errors)
{
$exceptionClass = get_class($ex);
$stack = $ex->getTraceAsString();
$stackDetail = print_r($errors, true);
$currentUrl = Zend_OpenId::selfURL();
if ($user->role = ROLE_GUEST) {
$userLabel = 'Anonymous';
} else {
$userLabel = $user->getFullName() . '(' . $user->username . ')';
}

$body = <<<EOD
Dear Admin,

An error has occured in your Community-ID installation.

URL requested: $currentUrl

By User: $userLabel

Exception: $exceptionClass

Call stack:
$stack

Call stack detail:
$stackDetail
EOD;

// can't use $this-_config 'cause it's a static function
$configEmail = Zend_Registry::get('config')->email;

switch (strtolower($configEmail->transport)) {
case 'smtp':
Zend_Mail::setDefaultTransport(
new Zend_Mail_Transport_Smtp(
$configEmail->host,
$configEmail->toArray()
)
);
break;
case 'mock':
Zend_Mail::setDefaultTransport(new Zend_Mail_Transport_Mock());
break;
default:
Zend_Mail::setDefaultTransport(new Zend_Mail_Transport_Sendmail());
}

$mail = new Zend_Mail();
$mail->setBodyText($body);
$mail->setFrom('support@community-id.org');
$mail->addTo($configEmail->adminemail);
$mail->setSubject('Community-ID error report');

return $mail;
}
}

View File

@ -0,0 +1,72 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

class Monkeys_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
{
private $_acl;

public function __construct($acl)
{
$this->_acl = $acl;
}

public function preDispatch($request)
{
if (!Zend_Registry::get('config')->environment->installed
&& $request->getModuleName() != 'install'
&& $request->getControllerName() != 'error')
{
$request->setModuleName('install');
$request->setControllerName('index');
$request->setActionName('index');

return;
}

if (Zend_Registry::isRegistered('user')) {
// used by unit tests to inject the logged-in user
$user= Zend_Registry::get('user');
} else {
$auth = Zend_Auth::getInstance();
$users = new Users();
if ($auth->hasIdentity()) {
$user = $auth->getStorage()->read();
$user->init();

// reactivate row as live data
$user->setTable($users);
} else {
// guest user
$user = $users->createRow();
}

Zend_Registry::set('user', $user);
}

$resource = $request->getModuleName() . '_' . $request->getControllerName();

if (!$this->_acl->has($resource)) {
//echo "role: " . $user->role . " - resource: $resource - privilege: " . $request->getActionName() . "<br>\n";
throw new Monkeys_BadUrlException($this->getRequest()->getRequestUri());
}

// if an admin is not allowed for this action, then the action doesn't exist
if (!$this->_acl->isAllowed(User::ROLE_ADMIN, $resource, $request->getActionName())) {
//echo "role: " . $user->role . " - resource: $resource - privilege: " . $request->getActionName() . "<br>\n";
throw new Monkeys_BadUrlException($this->getRequest()->getRequestUri());
}

if (!$this->_acl->isAllowed($user->role, $resource, $request->getActionName())) {
//echo "role: " . $user->role . " - resource: $resource - privilege: " . $request->getActionName() . "<br>\n";
throw new Monkeys_AccessDeniedException();
}
}
}

24
libs/Monkeys/Db/Profiler.php Executable file
View File

@ -0,0 +1,24 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

class Monkeys_Db_Profiler extends Zend_Db_Profiler
{
public function Monkeys_Db_Profiler()
{
parent::__construct(true);
}

public function queryStart($queryText, $queryType = null)
{
Zend_Registry::get('logger')->log("DB QUERY: $queryText", Zend_Log::DEBUG);
return parent::queryStart($queryText, $queryType);
}
}

View File

@ -0,0 +1,18 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

abstract class Monkeys_Db_Table_Gateway extends Zend_Db_Table_Abstract
{
public function getRowInstance($id)
{
return $this->fetchRow($this->select()->where('id = ?', $id));
}
}

View File

@ -0,0 +1,136 @@
<?

class Monkeys_Form_Decorator_Composite extends Zend_Form_Decorator_Abstract
{
public function buildLabel()
{
$element = $this->getElement();
$label = $element->getLabel();
if ($translator = $element->getTranslator()) {
$label = $translator->translate($label);
}
if ($element->isRequired()) {
$label .= '*';
}

return $label . ':';
/*return $element->getView()
->formLabel($element->getName(), $label);*/
}

public function buildInput($content = '')
{
$element = $this->getElement();
$helper = $element->helper;
$attribs = $element->getAttribs();
if ($this->getOption('bottom')) {
$attribs = array_merge($attribs, array('style' => 'top:0; width:auto'));
}

if ($element instanceof Monkeys_Form_Element_Captcha) {
return $content;
}

$input = $element->getView()->$helper(
$element->getName(),
$element->getValue(),
$attribs,
$element->options,
$this->getSeparator()
);

if ($element instanceof Monkeys_Form_Element_Radio) {
return "<div class=\"formRadio\">$input</div>";
}

return $input;
}

public function buildErrors()
{
$element = $this->getElement();
$messages = $element->getMessages();
if (empty($messages)) {
return '';
}
return $element->getView()->formErrors($messages);
/*return '<div class="errors">' .
$element->getView()->formErrors($messages) . '</div>';*/
}

public function buildDescription()
{
$element = $this->getElement();
$desc = $element->getDescription();
if (empty($desc)) {
return '';
}
if ($translator = $element->getTranslator()) {
$desc = $translator->translate($desc);
}

return $desc;
}

public function render($content)
{
$element = $this->getElement();
if (!$element instanceof Zend_Form_Element) {
return $content;
}
if (null === $element->getView()) {
return $content;
}

$placement = $this->getPlacement();
$label = $this->buildLabel();
$input = $this->buildInput($content);
$errors = $this->buildErrors();
$desc = $this->buildDescription();

if ($desc && $errors) {
$desc = "<div>$desc</div>";
} else if ($desc && !$errors) {
$desc = "<div class=\"description\">$desc</div>";
}

if ($this->getOption('yuiGridType')) {
$yuiGridType = $this->getOption('yuiGridType');
} else {
$yuiGridType = 'gf';
}

if ($this->getOption('wideLabel')) {
$output = "<div class=\"yui-$yuiGridType\" style=\"padding-bottom:10px\">\n"
." <div class=\"formLabel\" style=\"padding-bottom:10px\">$label</div>\n"
." <div class=\"yui-u first\">&nbsp;</div>\n"
." <div class=\"yui-u\">\n"
." $input\n"
." $desc\n"
. ($errors? " <div>$errors</div>\n" : "")
." </div>\n"
."</div>\n";
} else if ($this->getOption('continuous')) {
$output = "<div style=\"padding-bottom:10px\">\n"
." <span class=\"formLabel\">$label</span> $input"
." <div>\n"
." $desc\n"
. ($errors? " <div>$errors</div>\n" : "")
." </div>\n"
."</div>\n";
} else {
$output = "<div class=\"yui-$yuiGridType\">\n"
." <div class=\"yui-u first\">$label</div>\n"
." <div class=\"yui-u\">\n"
." $input\n"
." $desc\n"
. ($errors? " <div>$errors</div>\n" : "")
." </div>\n"
."</div>\n";
}

return $output;
}
}

View File

@ -0,0 +1,38 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

/**
* I was obliged to do this because of a mayor flaw of Zend_Form_Element_Captcha
* not letting using custom captcha adapters
* (if the adapter is not defined in the construct, an exception is thrown, so I don't
* even have a chance to call addPrefixPath() on the element...)
*/
class Monkeys_Form_Element_Captcha extends Zend_Form_Element_Captcha
{
private $_decorator;

public function __construct($spec, $options = null)
{
$this->addPrefixPath('Monkeys_Captcha', 'Monkeys/Captcha/', 'captcha');
$options = array_merge($options, array('disableLoadDefaultDecorators' =>true));
parent::__construct($spec, $options);

$this->_decorator = new Monkeys_Form_Decorator_Composite();
$this->addDecorator($this->_decorator);
}

public function setDecoratorOptions(array $options)
{
$this->_decorator->setOptions($options);

return $this;
}
}

View File

@ -0,0 +1,23 @@
<?php

class Monkeys_Form_Element_Checkbox extends Zend_Form_Element_Checkbox
{
private $_decorator;

public function __construct($spec, $options = array())
{
$options = array_merge($options, array('disableLoadDefaultDecorators' =>true));
parent::__construct($spec, $options);

$this->_decorator = new Monkeys_Form_Decorator_Composite();
$this->addDecorator($this->_decorator);
}

public function setDecoratorOptions(array $options)
{
$this->_decorator->setOptions($options);

return $this;
}
}

View File

@ -0,0 +1,41 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

class Monkeys_Form_Element_Country extends Zend_Form_Element_Select
{
private $_decorator;

public function __construct($spec, $options = array())
{
$options = array_merge($options, array('disableLoadDefaultDecorators' =>true));
parent::__construct($spec, $options);

$this->_decorator = new Monkeys_Form_Decorator_Composite();
$this->addDecorator($this->_decorator);
}

public function setDecoratorOptions(array $options)
{
$this->_decorator->setOptions($options);

return $this;
}

public function init()
{
parent::init();
translate('-- Select a Country --');
$this->addMultiOption(0, '-- Select a Country --');
$this->addMultiOptions(Zend_Locale::getCountryTranslationList(Zend_Registry::get('Zend_Locale')));
asort($this->options);
}
}

View File

@ -0,0 +1,164 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD Licensese
* @author Keyboard Monkeys Ltd.
* @since CommunityID0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

/**
* Based on
* http://zfsite.andreinikolov.com/2008/05/part-4-zend_form-captcha-password-confirmation-date-selector-field-zend_translate/
*/
class Monkeys_Form_Element_Date extends Zend_Form_Element_Xhtml
{
/**
* Use formSelect view helper by default
* @var string
*/
public $helper = 'formDateSelects';
/**
* This array will hold options:
* showEmpty - bool, if true will show and allow empty date
* startYear, endYear - start and end year to show
* reverseYears - if true - years will be print from most recent backwards
*
* Zend_Form_Decorator_ViewHelper will pass this array as argument to the
* view helper, responsible for rendering this element
*
* @var array
*/
public $options = array();

private $_decorator;

public function __construct($spec, $options = array())
{
$options = array_merge($options, array('disableLoadDefaultDecorators' =>true));
parent::__construct($spec, $options);

$this->_decorator = new Monkeys_Form_Decorator_Composite();
$this->addDecorator($this->_decorator);
}

public function setDecoratorOptions(array $options)
{
$this->_decorator->setOptions($options);

return $this;
}
public function init()
{
$this->options['showEmpty'] = true;
$this->options['startYear'] = 1900;
$this->options['endYear'] = (int) date("Y");
$this->options['reverseYears'] = false;
}
public function setShowEmptyValues($value)
{
$this->options['showEmpty'] = (bool) $value;
return $this;
}
public function setStartEndYear($start = null, $end = null)
{
if ($start)
{
$this->options['startYear'] = (int) $start;
}
if ($end)
{
$this->options['endYear'] = (int) $end;
}
return $this;
}
public function setReverseYears($value)
{
$this->options['reverseYears'] = (bool) $value;
return $this;
}
/**
* We want to get the date from our auxiliary fields here
*
* @param mixed $value
* @param mixed $context
* @return boolean
*/
public function isValid($value, $context = null)
{
$fieldName = $this->getName();
$auxiliaryFieldsNames = $this->getDayMonthYearFieldNames($fieldName);
if (isset($context[$auxiliaryFieldsNames['day']]) && isset($context[$auxiliaryFieldsNames['month']])
&& isset($context[$auxiliaryFieldsNames['year']]))
{
if ($context[$auxiliaryFieldsNames['year']] == '-'
|| $context[$auxiliaryFieldsNames['month']] == '-'
|| $context[$auxiliaryFieldsNames['day']] == '-')
{
$value = null;
}
else
{
$value = str_pad($context[$auxiliaryFieldsNames['year']], 4, '0', STR_PAD_LEFT) . '-'
. str_pad($context[$auxiliaryFieldsNames['month']], 2, '0', STR_PAD_LEFT) . '-'
. str_pad($context[$auxiliaryFieldsNames['day']], 2, '0', STR_PAD_LEFT);
}
$this->setValue($value);
}
return parent::isValid($value, $context);
}
/**
* Makes day, month and year names from given element name. Special case is array notation.
*
* Given a value such as foo[bar][baz], the generated names will be
* foo[bar][baz_day], foo[bar][baz_month] and foo[bar][baz_year]
* I know it is bad design to have this function here and in the View Helper,
* but I really can't think of other way
*
* @param string $value
* @return array
*/
protected function getDayMonthYearFieldNames($value)
{
if (empty($value) || !is_string($value)) {
return $value;
}
$ret = array(
'day' => $value . '_day',
'month' => $value . '_month',
'year' => $value . '_year'
);
if (strstr($value, '['))
{
$endPos = strlen($value) - 1;
if (']' != $value[$endPos]) {
return $ret;
}
$start = strrpos($value, '[') + 1;
$name = substr($value, $start, $endPos - $start);
$arrayName = substr($value, 0, $start-1);
$ret = array(
'day' => $arrayName . '[' . $name . '_day' . ']',
'month' => $arrayName . '[' . $name . '_month' . ']',
'year' => $arrayName . '[' . $name . '_year' . ']'
);
}
return $ret;
}
}

View File

@ -0,0 +1,23 @@
<?php

class Monkeys_Form_Element_File extends Zend_Form_Element_File
{
private $_decorator;

public function __construct($spec, $options = array())
{
$options = array_merge($options, array('disableLoadDefaultDecorators' =>true));
parent::__construct($spec, $options);

$this->_decorator = new Monkeys_Form_Decorator_Composite();
$this->addDecorator($this->_decorator);
}

public function setDecoratorOptions(array $options)
{
$this->_decorator->setOptions($options);

return $this;
}
}

View File

@ -0,0 +1,41 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

class Monkeys_Form_Element_Language extends Zend_Form_Element_Select
{
private $_decorator;

public function __construct($spec, $options = array())
{
$options = array_merge($options, array('disableLoadDefaultDecorators' =>true));
parent::__construct($spec, $options);

$this->_decorator = new Monkeys_Form_Decorator_Composite();
$this->addDecorator($this->_decorator);
}

public function setDecoratorOptions(array $options)
{
$this->_decorator->setOptions($options);

return $this;
}

public function init()
{
parent::init();

translate('-- Select a Language --');
$this->addMultiOption(0, '-- Select a Language --');
$this->addMultiOptions(Zend_Locale::getLanguageTranslationList(Zend_Registry::get('Zend_Locale')));
asort($this->options);
}
}

View File

@ -0,0 +1,13 @@
<?php

class Monkeys_Form_Element_Password extends Zend_Form_Element_Password
{
public function __construct($spec, $options = array())
{
$options = array_merge($options, array('disableLoadDefaultDecorators' =>true));
parent::__construct($spec, $options);

$this->addDecorator(new Monkeys_Form_Decorator_Composite());
}
}

View File

@ -0,0 +1,23 @@
<?php

class Monkeys_Form_Element_Radio extends Zend_Form_Element_Radio
{
private $_decorator;

public function __construct($spec, $options = array())
{
$options = array_merge($options, array('disableLoadDefaultDecorators' =>true));
parent::__construct($spec, $options);

$this->_decorator = new Monkeys_Form_Decorator_Composite();
$this->addDecorator($this->_decorator);
}

public function setDecoratorOptions(array $options)
{
$this->_decorator->setOptions($options);

return $this;
}
}

View File

@ -0,0 +1,22 @@
<?php

class Monkeys_Form_Element_Text extends Zend_Form_Element_Text
{
private $_decorator;

public function __construct($spec, $options = array())
{
$options = array_merge($options, array('disableLoadDefaultDecorators' =>true));
parent::__construct($spec, $options);

$this->_decorator = new Monkeys_Form_Decorator_Composite();
$this->addDecorator($this->_decorator);
}

public function setDecoratorOptions(array $options)
{
$this->_decorator->setOptions($options);

return $this;
}
}

View File

@ -0,0 +1,23 @@
<?php

class Monkeys_Form_Element_Textarea extends Zend_Form_Element_Textarea
{
private $_decorator;

public function __construct($spec, $options = array())
{
$options = array_merge($options, array('disableLoadDefaultDecorators' =>true));
parent::__construct($spec, $options);

$this->_decorator = new Monkeys_Form_Decorator_Composite();
$this->addDecorator($this->_decorator);
}

public function setDecoratorOptions(array $options)
{
$this->_decorator->setOptions($options);

return $this;
}
}

View File

@ -0,0 +1,54 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

class Monkeys_Form_Element_Timezone extends Zend_Form_Element_Select
{
private $_decorator;

public function __construct($spec, $options = array())
{
$options = array_merge($options, array('disableLoadDefaultDecorators' =>true));
parent::__construct($spec, $options);

$this->_decorator = new Monkeys_Form_Decorator_Composite();
$this->addDecorator($this->_decorator);
}

public function setDecoratorOptions(array $options)
{
$this->_decorator->setOptions($options);

return $this;
}

public function init()
{
parent::init();

$fp = fopen(dirname(__FILE__) . '/zone.tab', 'r');
$timezones = array();
while ($row = fgets($fp)) {
if ($row[0] == '#') {
continue;
}

$elements = explode("\t", $row);
$timezones[trim($elements[2])] = trim(strtr($elements[2], '_', ' '));
}
ksort($timezones);

translate('-- Select a Timezone --');
$this->addMultiOption(0, '-- Select a Timezone --');
foreach ($timezones as $key => $value) {
$this->addMultiOption($key, $value);
}
}
}

View File

@ -0,0 +1,425 @@
# @(#)zone.tab 8.21
#
# TZ zone descriptions
#
# From Paul Eggert (1996-08-05):
#
# This file contains a table with the following columns:
# 1. ISO 3166 2-character country code. See the file `iso3166.tab'.
# 2. Latitude and longitude of the zone's principal location
# in ISO 6709 sign-degrees-minutes-seconds format,
# either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
# first latitude (+ is north), then longitude (+ is east).
# 3. Zone name used in value of TZ environment variable.
# 4. Comments; present if and only if the country has multiple rows.
#
# Columns are separated by a single tab.
# The table is sorted first by country, then an order within the country that
# (1) makes some geographical sense, and
# (2) puts the most populous zones first, where that does not contradict (1).
#
# Lines beginning with `#' are comments.
#
#country-
#code coordinates TZ comments
AD +4230+00131 Europe/Andorra
AE +2518+05518 Asia/Dubai
AF +3431+06912 Asia/Kabul
AG +1703-06148 America/Antigua
AI +1812-06304 America/Anguilla
AL +4120+01950 Europe/Tirane
AM +4011+04430 Asia/Yerevan
AN +1211-06900 America/Curacao
AO -0848+01314 Africa/Luanda
AQ -7750+16636 Antarctica/McMurdo McMurdo Station, Ross Island
AQ -9000+00000 Antarctica/South_Pole Amundsen-Scott Station, South Pole
AQ -6734-06808 Antarctica/Rothera Rothera Station, Adelaide Island
AQ -6448-06406 Antarctica/Palmer Palmer Station, Anvers Island
AQ -6736+06253 Antarctica/Mawson Mawson Station, Holme Bay
AQ -6835+07758 Antarctica/Davis Davis Station, Vestfold Hills
AQ -6617+11031 Antarctica/Casey Casey Station, Bailey Peninsula
AQ -7824+10654 Antarctica/Vostok Vostok Station, S Magnetic Pole
AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie
AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I
AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF)
AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF)
AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN)
AR -2411-06518 America/Argentina/Jujuy Jujuy (JY)
AR -2649-06513 America/Argentina/Tucuman Tucuman (TM)
AR -2828-06547 America/Argentina/Catamarca Catamarca (CT), Chubut (CH)
AR -2926-06651 America/Argentina/La_Rioja La Rioja (LR)
AR -3132-06831 America/Argentina/San_Juan San Juan (SJ)
AR -3253-06849 America/Argentina/Mendoza Mendoza (MZ)
AR -3319-06621 America/Argentina/San_Luis San Luis (SL)
AR -5138-06913 America/Argentina/Rio_Gallegos Santa Cruz (SC)
AR -5448-06818 America/Argentina/Ushuaia Tierra del Fuego (TF)
AS -1416-17042 Pacific/Pago_Pago
AT +4813+01620 Europe/Vienna
AU -3133+15905 Australia/Lord_Howe Lord Howe Island
AU -4253+14719 Australia/Hobart Tasmania - most locations
AU -3956+14352 Australia/Currie Tasmania - King Island
AU -3749+14458 Australia/Melbourne Victoria
AU -3352+15113 Australia/Sydney New South Wales - most locations
AU -3157+14127 Australia/Broken_Hill New South Wales - Yancowinna
AU -2728+15302 Australia/Brisbane Queensland - most locations
AU -2016+14900 Australia/Lindeman Queensland - Holiday Islands
AU -3455+13835 Australia/Adelaide South Australia
AU -1228+13050 Australia/Darwin Northern Territory
AU -3157+11551 Australia/Perth Western Australia - most locations
AU -3143+12852 Australia/Eucla Western Australia - Eucla area
AW +1230-06958 America/Aruba
AX +6006+01957 Europe/Mariehamn
AZ +4023+04951 Asia/Baku
BA +4352+01825 Europe/Sarajevo
BB +1306-05937 America/Barbados
BD +2343+09025 Asia/Dhaka
BE +5050+00420 Europe/Brussels
BF +1222-00131 Africa/Ouagadougou
BG +4241+02319 Europe/Sofia
BH +2623+05035 Asia/Bahrain
BI -0323+02922 Africa/Bujumbura
BJ +0629+00237 Africa/Porto-Novo
BL +1753-06251 America/St_Barthelemy
BM +3217-06446 Atlantic/Bermuda
BN +0456+11455 Asia/Brunei
BO -1630-06809 America/La_Paz
BR -0351-03225 America/Noronha Atlantic islands
BR -0127-04829 America/Belem Amapa, E Para
BR -0343-03830 America/Fortaleza NE Brazil (MA, PI, CE, RN, PB)
BR -0803-03454 America/Recife Pernambuco
BR -0712-04812 America/Araguaina Tocantins
BR -0940-03543 America/Maceio Alagoas, Sergipe
BR -1259-03831 America/Bahia Bahia
BR -2332-04637 America/Sao_Paulo S & SE Brazil (GO, DF, MG, ES, RJ, SP, PR, SC, RS)
BR -2027-05437 America/Campo_Grande Mato Grosso do Sul
BR -1535-05605 America/Cuiaba Mato Grosso
BR -0226-05452 America/Santarem W Para
BR -0846-06354 America/Porto_Velho Rondonia
BR +0249-06040 America/Boa_Vista Roraima
BR -0308-06001 America/Manaus E Amazonas
BR -0640-06952 America/Eirunepe W Amazonas
BR -0958-06748 America/Rio_Branco Acre
BS +2505-07721 America/Nassau
BT +2728+08939 Asia/Thimphu
BW -2545+02555 Africa/Gaborone
BY +5354+02734 Europe/Minsk
BZ +1730-08812 America/Belize
CA +4734-05243 America/St_Johns Newfoundland Time, including SE Labrador
CA +4439-06336 America/Halifax Atlantic Time - Nova Scotia (most places), PEI
CA +4612-05957 America/Glace_Bay Atlantic Time - Nova Scotia - places that did not observe DST 1966-1971
CA +4606-06447 America/Moncton Atlantic Time - New Brunswick
CA +5320-06025 America/Goose_Bay Atlantic Time - Labrador - most locations
CA +5125-05707 America/Blanc-Sablon Atlantic Standard Time - Quebec - Lower North Shore
CA +4531-07334 America/Montreal Eastern Time - Quebec - most locations
CA +4339-07923 America/Toronto Eastern Time - Ontario - most locations
CA +4901-08816 America/Nipigon Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973
CA +4823-08915 America/Thunder_Bay Eastern Time - Thunder Bay, Ontario
CA +6344-06828 America/Iqaluit Eastern Time - east Nunavut - most locations
CA +6608-06544 America/Pangnirtung Eastern Time - Pangnirtung, Nunavut
CA +744144-0944945 America/Resolute Eastern Time - Resolute, Nunavut
CA +484531-0913718 America/Atikokan Eastern Standard Time - Atikokan, Ontario and Southampton I, Nunavut
CA +624900-0920459 America/Rankin_Inlet Central Time - central Nunavut
CA +4953-09709 America/Winnipeg Central Time - Manitoba & west Ontario
CA +4843-09434 America/Rainy_River Central Time - Rainy River & Fort Frances, Ontario
CA +5024-10439 America/Regina Central Standard Time - Saskatchewan - most locations
CA +5017-10750 America/Swift_Current Central Standard Time - Saskatchewan - midwest
CA +5333-11328 America/Edmonton Mountain Time - Alberta, east British Columbia & west Saskatchewan
CA +690650-1050310 America/Cambridge_Bay Mountain Time - west Nunavut
CA +6227-11421 America/Yellowknife Mountain Time - central Northwest Territories
CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories
CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia
CA +4916-12307 America/Vancouver Pacific Time - west British Columbia
CA +6043-13503 America/Whitehorse Pacific Time - south Yukon
CA +6404-13925 America/Dawson Pacific Time - north Yukon
CC -1210+09655 Indian/Cocos
CD -0418+01518 Africa/Kinshasa west Dem. Rep. of Congo
CD -1140+02728 Africa/Lubumbashi east Dem. Rep. of Congo
CF +0422+01835 Africa/Bangui
CG -0416+01517 Africa/Brazzaville
CH +4723+00832 Europe/Zurich
CI +0519-00402 Africa/Abidjan
CK -2114-15946 Pacific/Rarotonga
CL -3327-07040 America/Santiago most locations
CL -2709-10926 Pacific/Easter Easter Island & Sala y Gomez
CM +0403+00942 Africa/Douala
CN +3114+12128 Asia/Shanghai east China - Beijing, Guangdong, Shanghai, etc.
CN +4545+12641 Asia/Harbin Heilongjiang (except Mohe), Jilin
CN +2934+10635 Asia/Chongqing central China - Sichuan, Yunnan, Guangxi, Shaanxi, Guizhou, etc.
CN +4348+08735 Asia/Urumqi most of Tibet & Xinjiang
CN +3929+07559 Asia/Kashgar west Tibet & Xinjiang
CO +0436-07405 America/Bogota
CR +0956-08405 America/Costa_Rica
CU +2308-08222 America/Havana
CV +1455-02331 Atlantic/Cape_Verde
CX -1025+10543 Indian/Christmas
CY +3510+03322 Asia/Nicosia
CZ +5005+01426 Europe/Prague
DE +5230+01322 Europe/Berlin
DJ +1136+04309 Africa/Djibouti
DK +5540+01235 Europe/Copenhagen
DM +1518-06124 America/Dominica
DO +1828-06954 America/Santo_Domingo
DZ +3647+00303 Africa/Algiers
EC -0210-07950 America/Guayaquil mainland
EC -0054-08936 Pacific/Galapagos Galapagos Islands
EE +5925+02445 Europe/Tallinn
EG +3003+03115 Africa/Cairo
EH +2709-01312 Africa/El_Aaiun
ER +1520+03853 Africa/Asmara
ES +4024-00341 Europe/Madrid mainland
ES +3553-00519 Africa/Ceuta Ceuta & Melilla
ES +2806-01524 Atlantic/Canary Canary Islands
ET +0902+03842 Africa/Addis_Ababa
FI +6010+02458 Europe/Helsinki
FJ -1808+17825 Pacific/Fiji
FK -5142-05751 Atlantic/Stanley
FM +0725+15147 Pacific/Truk Truk (Chuuk) and Yap
FM +0658+15813 Pacific/Ponape Ponape (Pohnpei)
FM +0519+16259 Pacific/Kosrae Kosrae
FO +6201-00646 Atlantic/Faroe
FR +4852+00220 Europe/Paris
GA +0023+00927 Africa/Libreville
GB +513030-0000731 Europe/London
GD +1203-06145 America/Grenada
GE +4143+04449 Asia/Tbilisi
GF +0456-05220 America/Cayenne
GG +4927-00232 Europe/Guernsey
GH +0533-00013 Africa/Accra
GI +3608-00521 Europe/Gibraltar
GL +6411-05144 America/Godthab most locations
GL +7646-01840 America/Danmarkshavn east coast, north of Scoresbysund
GL +7029-02158 America/Scoresbysund Scoresbysund / Ittoqqortoormiit
GL +7634-06847 America/Thule Thule / Pituffik
GM +1328-01639 Africa/Banjul
GN +0931-01343 Africa/Conakry
GP +1614-06132 America/Guadeloupe
GQ +0345+00847 Africa/Malabo
GR +3758+02343 Europe/Athens
GS -5416-03632 Atlantic/South_Georgia
GT +1438-09031 America/Guatemala
GU +1328+14445 Pacific/Guam
GW +1151-01535 Africa/Bissau
GY +0648-05810 America/Guyana
HK +2217+11409 Asia/Hong_Kong
HN +1406-08713 America/Tegucigalpa
HR +4548+01558 Europe/Zagreb
HT +1832-07220 America/Port-au-Prince
HU +4730+01905 Europe/Budapest
ID -0610+10648 Asia/Jakarta Java & Sumatra
ID -0002+10920 Asia/Pontianak west & central Borneo
ID -0507+11924 Asia/Makassar east & south Borneo, Celebes, Bali, Nusa Tengarra, west Timor
ID -0232+14042 Asia/Jayapura Irian Jaya & the Moluccas
IE +5320-00615 Europe/Dublin
IL +3146+03514 Asia/Jerusalem
IM +5409-00428 Europe/Isle_of_Man
IN +2232+08822 Asia/Kolkata
IO -0720+07225 Indian/Chagos
IQ +3321+04425 Asia/Baghdad
IR +3540+05126 Asia/Tehran
IS +6409-02151 Atlantic/Reykjavik
IT +4154+01229 Europe/Rome
JE +4912-00207 Europe/Jersey
JM +1800-07648 America/Jamaica
JO +3157+03556 Asia/Amman
JP +353916+1394441 Asia/Tokyo
KE -0117+03649 Africa/Nairobi
KG +4254+07436 Asia/Bishkek
KH +1133+10455 Asia/Phnom_Penh
KI +0125+17300 Pacific/Tarawa Gilbert Islands
KI -0308-17105 Pacific/Enderbury Phoenix Islands
KI +0152-15720 Pacific/Kiritimati Line Islands
KM -1141+04316 Indian/Comoro
KN +1718-06243 America/St_Kitts
KP +3901+12545 Asia/Pyongyang
KR +3733+12658 Asia/Seoul
KW +2920+04759 Asia/Kuwait
KY +1918-08123 America/Cayman
KZ +4315+07657 Asia/Almaty most locations
KZ +4448+06528 Asia/Qyzylorda Qyzylorda (Kyzylorda, Kzyl-Orda)
KZ +5017+05710 Asia/Aqtobe Aqtobe (Aktobe)
KZ +4431+05016 Asia/Aqtau Atyrau (Atirau, Gur'yev), Mangghystau (Mankistau)
KZ +5113+05121 Asia/Oral West Kazakhstan
LA +1758+10236 Asia/Vientiane
LB +3353+03530 Asia/Beirut
LC +1401-06100 America/St_Lucia
LI +4709+00931 Europe/Vaduz
LK +0656+07951 Asia/Colombo
LR +0618-01047 Africa/Monrovia
LS -2928+02730 Africa/Maseru
LT +5441+02519 Europe/Vilnius
LU +4936+00609 Europe/Luxembourg
LV +5657+02406 Europe/Riga
LY +3254+01311 Africa/Tripoli
MA +3339-00735 Africa/Casablanca
MC +4342+00723 Europe/Monaco
MD +4700+02850 Europe/Chisinau
ME +4226+01916 Europe/Podgorica
MF +1804-06305 America/Marigot
MG -1855+04731 Indian/Antananarivo
MH +0709+17112 Pacific/Majuro most locations
MH +0905+16720 Pacific/Kwajalein Kwajalein
MK +4159+02126 Europe/Skopje
ML +1239-00800 Africa/Bamako
MM +1647+09610 Asia/Rangoon
MN +4755+10653 Asia/Ulaanbaatar most locations
MN +4801+09139 Asia/Hovd Bayan-Olgiy, Govi-Altai, Hovd, Uvs, Zavkhan
MN +4804+11430 Asia/Choibalsan Dornod, Sukhbaatar
MO +2214+11335 Asia/Macau
MP +1512+14545 Pacific/Saipan
MQ +1436-06105 America/Martinique
MR +1806-01557 Africa/Nouakchott
MS +1643-06213 America/Montserrat
MT +3554+01431 Europe/Malta
MU -2010+05730 Indian/Mauritius
MV +0410+07330 Indian/Maldives
MW -1547+03500 Africa/Blantyre
MX +1924-09909 America/Mexico_City Central Time - most locations
MX +2105-08646 America/Cancun Central Time - Quintana Roo
MX +2058-08937 America/Merida Central Time - Campeche, Yucatan
MX +2540-10019 America/Monterrey Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas
MX +2313-10625 America/Mazatlan Mountain Time - S Baja, Nayarit, Sinaloa
MX +2838-10605 America/Chihuahua Mountain Time - Chihuahua
MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora
MX +3232-11701 America/Tijuana Pacific Time
MY +0310+10142 Asia/Kuala_Lumpur peninsular Malaysia
MY +0133+11020 Asia/Kuching Sabah & Sarawak
MZ -2558+03235 Africa/Maputo
NA -2234+01706 Africa/Windhoek
NC -2216+16530 Pacific/Noumea
NE +1331+00207 Africa/Niamey
NF -2903+16758 Pacific/Norfolk
NG +0627+00324 Africa/Lagos
NI +1209-08617 America/Managua
NL +5222+00454 Europe/Amsterdam
NO +5955+01045 Europe/Oslo
NP +2743+08519 Asia/Katmandu
NR -0031+16655 Pacific/Nauru
NU -1901-16955 Pacific/Niue
NZ -3652+17446 Pacific/Auckland most locations
NZ -4357-17633 Pacific/Chatham Chatham Islands
OM +2336+05835 Asia/Muscat
PA +0858-07932 America/Panama
PE -1203-07703 America/Lima
PF -1732-14934 Pacific/Tahiti Society Islands
PF -0900-13930 Pacific/Marquesas Marquesas Islands
PF -2308-13457 Pacific/Gambier Gambier Islands
PG -0930+14710 Pacific/Port_Moresby
PH +1435+12100 Asia/Manila
PK +2452+06703 Asia/Karachi
PL +5215+02100 Europe/Warsaw
PM +4703-05620 America/Miquelon
PN -2504-13005 Pacific/Pitcairn
PR +182806-0660622 America/Puerto_Rico
PS +3130+03428 Asia/Gaza
PT +3843-00908 Europe/Lisbon mainland
PT +3238-01654 Atlantic/Madeira Madeira Islands
PT +3744-02540 Atlantic/Azores Azores
PW +0720+13429 Pacific/Palau
PY -2516-05740 America/Asuncion
QA +2517+05132 Asia/Qatar
RE -2052+05528 Indian/Reunion
RO +4426+02606 Europe/Bucharest
RS +4450+02030 Europe/Belgrade
RU +5443+02030 Europe/Kaliningrad Moscow-01 - Kaliningrad
RU +5545+03735 Europe/Moscow Moscow+00 - west Russia
RU +4844+04425 Europe/Volgograd Moscow+00 - Caspian Sea
RU +5312+05009 Europe/Samara Moscow+01 - Samara, Udmurtia
RU +5651+06036 Asia/Yekaterinburg Moscow+02 - Urals
RU +5500+07324 Asia/Omsk Moscow+03 - west Siberia
RU +5502+08255 Asia/Novosibirsk Moscow+03 - Novosibirsk
RU +5601+09250 Asia/Krasnoyarsk Moscow+04 - Yenisei River
RU +5216+10420 Asia/Irkutsk Moscow+05 - Lake Baikal
RU +6200+12940 Asia/Yakutsk Moscow+06 - Lena River
RU +4310+13156 Asia/Vladivostok Moscow+07 - Amur River
RU +4658+14242 Asia/Sakhalin Moscow+07 - Sakhalin Island
RU +5934+15048 Asia/Magadan Moscow+08 - Magadan
RU +5301+15839 Asia/Kamchatka Moscow+09 - Kamchatka
RU +6445+17729 Asia/Anadyr Moscow+10 - Bering Sea
RW -0157+03004 Africa/Kigali
SA +2438+04643 Asia/Riyadh
SB -0932+16012 Pacific/Guadalcanal
SC -0440+05528 Indian/Mahe
SD +1536+03232 Africa/Khartoum
SE +5920+01803 Europe/Stockholm
SG +0117+10351 Asia/Singapore
SH -1555-00542 Atlantic/St_Helena
SI +4603+01431 Europe/Ljubljana
SJ +7800+01600 Arctic/Longyearbyen
SK +4809+01707 Europe/Bratislava
SL +0830-01315 Africa/Freetown
SM +4355+01228 Europe/San_Marino
SN +1440-01726 Africa/Dakar
SO +0204+04522 Africa/Mogadishu
SR +0550-05510 America/Paramaribo
ST +0020+00644 Africa/Sao_Tome
SV +1342-08912 America/El_Salvador
SY +3330+03618 Asia/Damascus
SZ -2618+03106 Africa/Mbabane
TC +2128-07108 America/Grand_Turk
TD +1207+01503 Africa/Ndjamena
TF -492110+0701303 Indian/Kerguelen
TG +0608+00113 Africa/Lome
TH +1345+10031 Asia/Bangkok
TJ +3835+06848 Asia/Dushanbe
TK -0922-17114 Pacific/Fakaofo
TL -0833+12535 Asia/Dili
TM +3757+05823 Asia/Ashgabat
TN +3648+01011 Africa/Tunis
TO -2110+17510 Pacific/Tongatapu
TR +4101+02858 Europe/Istanbul
TT +1039-06131 America/Port_of_Spain
TV -0831+17913 Pacific/Funafuti
TW +2503+12130 Asia/Taipei
TZ -0648+03917 Africa/Dar_es_Salaam
UA +5026+03031 Europe/Kiev most locations
UA +4837+02218 Europe/Uzhgorod Ruthenia
UA +4750+03510 Europe/Zaporozhye Zaporozh'ye, E Lugansk / Zaporizhia, E Luhansk
UA +4457+03406 Europe/Simferopol central Crimea
UG +0019+03225 Africa/Kampala
UM +1645-16931 Pacific/Johnston Johnston Atoll
UM +2813-17722 Pacific/Midway Midway Islands
UM +1917+16637 Pacific/Wake Wake Island
US +404251-0740023 America/New_York Eastern Time
US +421953-0830245 America/Detroit Eastern Time - Michigan - most locations
US +381515-0854534 America/Kentucky/Louisville Eastern Time - Kentucky - Louisville area
US +364947-0845057 America/Kentucky/Monticello Eastern Time - Kentucky - Wayne County
US +394606-0860929 America/Indiana/Indianapolis Eastern Time - Indiana - most locations
US +384038-0873143 America/Indiana/Vincennes Eastern Time - Indiana - Daviess, Dubois, Knox & Martin Counties
US +410305-0863611 America/Indiana/Winamac Eastern Time - Indiana - Pulaski County
US +382232-0862041 America/Indiana/Marengo Eastern Time - Indiana - Crawford County
US +382931-0871643 America/Indiana/Petersburg Eastern Time - Indiana - Pike County
US +384452-0850402 America/Indiana/Vevay Eastern Time - Indiana - Switzerland County
US +415100-0873900 America/Chicago Central Time
US +375711-0864541 America/Indiana/Tell_City Central Time - Indiana - Perry County
US +411745-0863730 America/Indiana/Knox Central Time - Indiana - Starke County
US +450628-0873651 America/Menominee Central Time - Michigan - Dickinson, Gogebic, Iron & Menominee Counties
US +470659-1011757 America/North_Dakota/Center Central Time - North Dakota - Oliver County
US +465042-1012439 America/North_Dakota/New_Salem Central Time - North Dakota - Morton County (except Mandan area)
US +394421-1045903 America/Denver Mountain Time
US +433649-1161209 America/Boise Mountain Time - south Idaho & east Oregon
US +364708-1084111 America/Shiprock Mountain Time - Navajo
US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona
US +340308-1181434 America/Los_Angeles Pacific Time
US +611305-1495401 America/Anchorage Alaska Time
US +581807-1342511 America/Juneau Alaska Time - Alaska panhandle
US +593249-1394338 America/Yakutat Alaska Time - Alaska panhandle neck
US +643004-1652423 America/Nome Alaska Time - west Alaska
US +515248-1763929 America/Adak Aleutian Islands
US +211825-1575130 Pacific/Honolulu Hawaii
UY -3453-05611 America/Montevideo
UZ +3940+06648 Asia/Samarkand west Uzbekistan
UZ +4120+06918 Asia/Tashkent east Uzbekistan
VA +4154+01227 Europe/Vatican
VC +1309-06114 America/St_Vincent
VE +1030-06656 America/Caracas
VG +1827-06437 America/Tortola
VI +1821-06456 America/St_Thomas
VN +1045+10640 Asia/Ho_Chi_Minh
VU -1740+16825 Pacific/Efate
WF -1318-17610 Pacific/Wallis
WS -1350-17144 Pacific/Apia
YE +1245+04512 Asia/Aden
YT -1247+04514 Indian/Mayotte
ZA -2615+02800 Africa/Johannesburg
ZM -1525+02817 Africa/Lusaka
ZW -1750+03103 Africa/Harare

View File

@ -0,0 +1,129 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

class Monkeys_OpenId_Provider_Storage_Database extends Zend_OpenId_Provider_Storage
{
public function addAssociation($handle, $macFunc, $secret, $expires)
{
$associations = new Associations();
$association = $associations->createRow();
$association->handle = $handle;
$association->macfunc = $macFunc;
$association->secret = $secret;
$association->expires = $expires;
$association->save();

return true;
}

public function getAssociation($handle, &$macFunc, &$secret, &$expires)
{
$associations = new Associations();
$association = $associations->getAssociationGivenHandle($handle);
if (!$association) {
return false;
}
if ($association->expires < time()) {
return false;
}

$macFunc = $association->macfunc;
$secret = $association->secret;
$expires = $association->expires;

return true;
}

/**
* Always returns false, since we'll be adding user through the GUI interface only
*/
public function addUser($id, $password)
{
return false;
}

public function hasUser($id)
{
$users = new Users();
$user = $users->getUserWithOpenId($id);

return $user? true : false;
}

public function checkUser($id, $password)
{
$auth = Zend_Auth::getInstance();
$db = Zend_Db::factory(Zend_Registry::get('config')->database);
$authAdapter = new Zend_Auth_Adapter_DbTable($db, 'users', 'openid', 'password');
$authAdapter->setIdentity($id);
$authAdapter->setCredential($password);
$result = $auth->authenticate($authAdapter);

if ($result->isValid()) {
// we don't wanna login into community-id
Zend_Auth::getInstance()->clearIdentity();

return true;
}

return false;
}

/**
* Returns array of all trusted/untrusted sites for given user identified
* by $id
*
* @param string $id user identity URL
* @return array
*/
public function getTrustedSites($id)
{
$users = new Users();
$user = $users->getUserWithOpenId($id);

$sites = new Sites();

$trustedSites = array();
foreach ($sites->getTrusted($user) as $site) {
$trustedSites[$site->site] = unserialize($site->trusted);
}

return $trustedSites;
}

/**
* Stores information about trusted/untrusted site for given user
*
* @param string $id user identity URL
* @param string $site site URL
* @param mixed $trusted trust data from extension or just a boolean value. If null, delete site. I know, bad desing. Blame it on ZF.
* @return bool
*/
public function addSite($id, $site, $trusted)
{
$users = new Users();
$user = $users->getUserWithOpenId($id);

$sites = new Sites();
$sites->deleteForUserSite($user, $site);

if (!is_null($trusted)) {
$siteObj = $sites->createRow();
$siteObj->user_id = $user->id;
$siteObj->site = $site;
$siteObj->creation_date = date('Y-m-d');
$siteObj->trusted = serialize($trusted);
$siteObj->save();
}

return true;
}
}

View File

@ -0,0 +1,38 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

class Monkeys_Validate_PasswordConfirmation extends Zend_Validate_Abstract
{
const NOT_MATCH = 'notMatch';

protected $_messageTemplates = array(
self::NOT_MATCH => 'Password confirmation does not match'
);

public function isValid($value, $context = null)
{
$value = (string) $value;
$this->_setValue($value);

if (is_array($context)) {
if (isset($context['password2'])
&& ($value == $context['password2']))
{
return true;
}
} elseif (is_string($context) && ($value == $context)) {
return true;
}

$this->_error(self::NOT_MATCH);
return false;
}
}

View File

@ -0,0 +1,281 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD Licensese
* @author Keyboard Monkeys Ltd.
* @since Textroller 0.9
* @package TextRoller
* @packager Keyboard Monkeys
*/

/**
* Based on
* http://zfsite.andreinikolov.com/2008/05/part-4-zend_form-captcha-password-confirmation-date-selector-field-zend_translate/
*/
class Monkeys_View_Helper_FormDateSelects extends Zend_View_Helper_FormElement
{
private $_months = array(
1 => 'January',
2 => 'February',
3 => 'March',
4 => 'April',
5 => 'May',
6 => 'June',
7 => 'July',
8 => 'August',
9 => 'Septembre',
10 => 'October',
11 => 'November',
12 => 'December'
);

/**
* Translation object
*
* @var Zend_Translate_Adapter
*/
protected $_translator;
public function formDateSelects($name, $value = null, $attribs = null,
$options = null, $listsep = "<br />\n")
{
$info = $this->_getInfo($name, $value, $attribs, $options, $listsep);
extract($info); // name, id, value, attribs, options, listsep, disable
// now start building the XHTML.
$disabled = '';
if (true === $disable) {
$disabled = ' disabled="disabled"';
}
$elementNamesArray = $this->getDayMonthYearFieldNames($name);
$valueDay = $valueMonth = $valueYear = null;
if ($value !== null)
{
$valueExploded = explode('-', $value);
if (!isset($valueExploded[2]))
$value = null;
else
{
$valueDay = (int) $valueExploded[2];
$valueMonth = (int) $valueExploded[1];
$valueYear = (int) $valueExploded[0];
}
}
// Build the surrounding day element first.
$xhtml = '<select '
. ' name="' . $this->view->escape($elementNamesArray['day']) . '"'
. ' id="' . $this->view->escape($id . '_day') . '"'
. $disabled
. $this->_htmlAttribs($attribs)
. ">\n ";
// build the list of options
$list = array();
if ($options['showEmpty'])
{
$list[] = '<option value="-"> </option>';
}
for ($i = 1; $i <= 31; $i++)
{
$list[] = '<option'
. ' value="' . $i . '"'
. ($valueDay === $i ? ' selected="selected"' : '')
. '>' . $i . '';
}
// add the options to the xhtml and close the select
$xhtml .= implode("\n ", $list) . "\n</select>";
// Build the month next
$xhtml .= ' <select '
. ' name="' . $this->view->escape($elementNamesArray['month']) . '"'
. ' id="' . $this->view->escape($id . '_month') . '"'
. $disabled
. $this->_htmlAttribs($attribs)
. ">\n ";
// build the list of options
$list = array();
if ($options['showEmpty'])
{
$list[] = '<option value="-"> </option>';
}
for ($i = 1; $i <= 12; $i++)
{
$list[] = '<option'
. ' value="' . $i . '"'
. ($valueMonth === $i ? ' selected="selected"' : '')
. '>' . $this->_translateValue($this->_months[$i]) . '';
}
// add the options to the xhtml and close the select
$xhtml .= implode("\n ", $list) . "\n</select>";
// Build the years next
$xhtml .= ' <select '
. ' name="' . $this->view->escape($elementNamesArray['year']) . '"'
. ' id="' . $this->view->escape($id . '_year') . '"'
. $disabled
. $this->_htmlAttribs($attribs)
. ">\n ";
// build the list of options
$list = array();
if ($options['showEmpty'])
{
$list[] = '<option value="-"> </option>';
}
if ($options['reverseYears'])
{
for ($i = $options['endYear']; $i >= $options['startYear']; $i--)
{
$list[] = '<option '
. ' value="' . $i . '"'
. ($valueYear === $i ? ' selected="selected"' : '')
. '>' . $i . '</option>';
}
}
else
{
for ($i = $options['startYear']; $i >= $options['endYear']; $i++)
{
$list[] = '<option '
. ' value="' . $i . '"'
. ($valueYear === $i ? ' selected="selected"' : '')
. '>' . $i . '</option>';
}
}
// add the options to the xhtml and close the select
$xhtml .= implode("\n ", $list) . "\n</select>";
return $xhtml;
}
/**
* Makes day, month and year names from given element name. Special case is array notation.
*
* Given a value such as foo[bar][baz], the generated names will be
* foo[bar][baz_day], foo[bar][baz_month] and foo[bar][baz_year]
*
* @param string $value
* @return array
*/
protected function getDayMonthYearFieldNames($value)
{
if (empty($value) || !is_string($value)) {
return $value;
}
$ret = array(
'day' => $value . '_day',
'month' => $value . '_month',
'year' => $value . '_year'
);
if (strstr($value, '['))
{
$endPos = strlen($value) - 1;
if (']' != $value[$endPos]) {
return $ret;
}
$start = strrpos($value, '[') + 1;
$name = substr($value, $start, $endPos - $start);
$arrayName = substr($value, 0, $start-1);
$ret = array(
'day' => $arrayName . '[' . $name . '_day' . ']',
'month' => $arrayName . '[' . $name . '_month' . ']',
'year' => $arrayName . '[' . $name . '_year' . ']'
);
}
return $ret;
}

/**
* Borrowed from multi option value's _translateValue()
*
* @param string $value
* @return string
*/
protected function _translateValue($value)
{
if (is_array($value)) {
foreach ($value as $key => $val) {
$value[$key] = $this->_translateValue($val);
}
return $value;
} else {
if (null !== ($translator = $this->getTranslator())) {
if ($translator->isTranslated($value)) {
return $translator->translate($value);
}
}
return $value;
}
}

/*
* Retrieve translation object (borrowed from Zend_View_Helper_HeadTitle)
*
* If none is currently registered, attempts to pull it from the registry
* using the key 'Zend_Translate'.
*
* @return Zend_Translate_Adapter|null
*/
public function getTranslator()
{
if (null === $this->_translator) {
require_once 'Zend/Registry.php';
if (Zend_Registry::isRegistered('Zend_Translate')) {
$this->setTranslator(Zend_Registry::get('Zend_Translate'));
}
}
return $this->_translator;
}

/**
* Sets a translation Adapter for translation (borrowed from Zend_View_Helper_HeadTitle)
*
* @param Zend_Translate|Zend_Translate_Adapter $translate
* @return Zend_View_Helper_HeadTitle
*/
public function setTranslator($translate)
{
if ($translate instanceof Zend_Translate_Adapter) {
$this->_translator = $translate;
} elseif ($translate instanceof Zend_Translate) {
$this->_translator = $translate->getAdapter();
} else {
require_once 'Zend/View/Exception.php';
throw new Zend_View_Exception("You must set an instance of Zend_Translate or Zend_Translate_Adapter");
}
return $this;
}

private function _translationsHolder()
{
translate('January');
translate('February');
translate('March');
translate('April');
translate('May');
translate('June');
translate('July');
translate('August');
translate('Septembre');
translate('October');
translate('November');
translate('December');
}

}

View File

@ -0,0 +1,26 @@
<?php

/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/

class Monkeys_View_Helper_GetBase
{
public function getBase()
{
$ctrl = Zend_Controller_Front::getInstance();
$baseUrl = $ctrl->getBaseUrl();
$url = rtrim($baseUrl, '/');

if (substr($baseUrl, strlen($baseUrl) - 9) == 'index.php') {
$url = substr($baseUrl, 0, strlen($baseUrl) - 10);
}

return $url;
}
}

Binary file not shown.

14371
libs/Monkeys/tests/names.txt Executable file

File diff suppressed because it is too large Load Diff

234935
libs/Monkeys/tests/words.txt Executable file

File diff suppressed because it is too large Load Diff

1036
libs/Zend/Acl.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,64 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Interface.php 8861 2008-03-16 14:30:18Z thomas $
*/


/**
* @see Zend_Acl
*/
require_once 'Zend/Acl.php';


/**
* @see Zend_Acl_Role_Interface
*/
require_once 'Zend/Acl/Role/Interface.php';


/**
* @see Zend_Acl_Resource_Interface
*/
require_once 'Zend/Acl/Resource/Interface.php';


/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Acl_Assert_Interface
{
/**
* Returns true if and only if the assertion conditions are met
*
* This method is passed the ACL, Role, Resource, and privilege to which the authorization query applies. If the
* $role, $resource, or $privilege parameters are null, it means that the query applies to all Roles, Resources, or
* privileges, respectively.
*
* @param Zend_Acl $acl
* @param Zend_Acl_Role_Interface $role
* @param Zend_Acl_Resource_Interface $resource
* @param string $privilege
* @return boolean
*/
public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role = null, Zend_Acl_Resource_Interface $resource = null,
$privilege = null);
}

View File

@ -0,0 +1,36 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 8861 2008-03-16 14:30:18Z thomas $
*/


/**
* @see Zend_Exception
*/
require_once 'Zend/Exception.php';


/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Acl_Exception extends Zend_Exception
{}

View File

@ -0,0 +1,65 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Resource.php 8861 2008-03-16 14:30:18Z thomas $
*/


/**
* @see Zend_Acl_Resource_Interface
*/
require_once 'Zend/Acl/Resource/Interface.php';


/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Acl_Resource implements Zend_Acl_Resource_Interface
{
/**
* Unique id of Resource
*
* @var string
*/
protected $_resourceId;

/**
* Sets the Resource identifier
*
* @param string $resourceId
* @return void
*/
public function __construct($resourceId)
{
$this->_resourceId = (string) $resourceId;
}

/**
* Defined by Zend_Acl_Resource_Interface; returns the Resource identifier
*
* @return string
*/
public function getResourceId()
{
return $this->_resourceId;
}

}

View File

@ -0,0 +1,37 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Interface.php 8861 2008-03-16 14:30:18Z thomas $
*/


/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Acl_Resource_Interface
{
/**
* Returns the string identifier of the Resource
*
* @return string
*/
public function getResourceId();
}

65
libs/Zend/Acl/Role.php Normal file
View File

@ -0,0 +1,65 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Role.php 8861 2008-03-16 14:30:18Z thomas $
*/


/**
* @see Zend_Acl_Role_Interface
*/
require_once 'Zend/Acl/Role/Interface.php';


/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Acl_Role implements Zend_Acl_Role_Interface
{
/**
* Unique id of Role
*
* @var string
*/
protected $_roleId;

/**
* Sets the Role identifier
*
* @param string $id
* @return void
*/
public function __construct($roleId)
{
$this->_roleId = (string) $roleId;
}

/**
* Defined by Zend_Acl_Role_Interface; returns the Role identifier
*
* @return string
*/
public function getRoleId()
{
return $this->_roleId;
}

}

View File

@ -0,0 +1,37 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Interface.php 8861 2008-03-16 14:30:18Z thomas $
*/


/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Acl_Role_Interface
{
/**
* Returns the string identifier of the Role
*
* @return string
*/
public function getRoleId();
}

View File

@ -0,0 +1,266 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Registry.php 8861 2008-03-16 14:30:18Z thomas $
*/


/**
* @see Zend_Acl_Role_Interface
*/
require_once 'Zend/Acl/Role/Interface.php';


/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Acl_Role_Registry
{
/**
* Internal Role registry data storage
*
* @var array
*/
protected $_roles = array();

/**
* Adds a Role having an identifier unique to the registry
*
* The $parents parameter may be a reference to, or the string identifier for,
* a Role existing in the registry, or $parents may be passed as an array of
* these - mixing string identifiers and objects is ok - to indicate the Roles
* from which the newly added Role will directly inherit.
*
* In order to resolve potential ambiguities with conflicting rules inherited
* from different parents, the most recently added parent takes precedence over
* parents that were previously added. In other words, the first parent added
* will have the least priority, and the last parent added will have the
* highest priority.
*
* @param Zend_Acl_Role_Interface $role
* @param Zend_Acl_Role_Interface|string|array $parents
* @throws Zend_Acl_Role_Registry_Exception
* @return Zend_Acl_Role_Registry Provides a fluent interface
*/
public function add(Zend_Acl_Role_Interface $role, $parents = null)
{
$roleId = $role->getRoleId();

if ($this->has($roleId)) {
/**
* @see Zend_Acl_Role_Registry_Exception
*/
require_once 'Zend/Acl/Role/Registry/Exception.php';
throw new Zend_Acl_Role_Registry_Exception("Role id '$roleId' already exists in the registry");
}

$roleParents = array();

if (null !== $parents) {
if (!is_array($parents)) {
$parents = array($parents);
}
/**
* @see Zend_Acl_Role_Registry_Exception
*/
require_once 'Zend/Acl/Role/Registry/Exception.php';
foreach ($parents as $parent) {
try {
if ($parent instanceof Zend_Acl_Role_Interface) {
$roleParentId = $parent->getRoleId();
} else {
$roleParentId = $parent;
}
$roleParent = $this->get($roleParentId);
} catch (Zend_Acl_Role_Registry_Exception $e) {
throw new Zend_Acl_Role_Registry_Exception("Parent Role id '$roleParentId' does not exist");
}
$roleParents[$roleParentId] = $roleParent;
$this->_roles[$roleParentId]['children'][$roleId] = $role;
}
}

$this->_roles[$roleId] = array(
'instance' => $role,
'parents' => $roleParents,
'children' => array()
);

return $this;
}

/**
* Returns the identified Role
*
* The $role parameter can either be a Role or a Role identifier.
*
* @param Zend_Acl_Role_Interface|string $role
* @throws Zend_Acl_Role_Registry_Exception
* @return Zend_Acl_Role_Interface
*/
public function get($role)
{
if ($role instanceof Zend_Acl_Role_Interface) {
$roleId = $role->getRoleId();
} else {
$roleId = (string) $role;
}

if (!$this->has($role)) {
/**
* @see Zend_Acl_Role_Registry_Exception
*/
require_once 'Zend/Acl/Role/Registry/Exception.php';
throw new Zend_Acl_Role_Registry_Exception("Role '$roleId' not found");
}

return $this->_roles[$roleId]['instance'];
}

/**
* Returns true if and only if the Role exists in the registry
*
* The $role parameter can either be a Role or a Role identifier.
*
* @param Zend_Acl_Role_Interface|string $role
* @return boolean
*/
public function has($role)
{
if ($role instanceof Zend_Acl_Role_Interface) {
$roleId = $role->getRoleId();
} else {
$roleId = (string) $role;
}

return isset($this->_roles[$roleId]);
}

/**
* Returns an array of an existing Role's parents
*
* The array keys are the identifiers of the parent Roles, and the values are
* the parent Role instances. The parent Roles are ordered in this array by
* ascending priority. The highest priority parent Role, last in the array,
* corresponds with the parent Role most recently added.
*
* If the Role does not have any parents, then an empty array is returned.
*
* @param Zend_Acl_Role_Interface|string $role
* @uses Zend_Acl_Role_Registry::get()
* @return array
*/
public function getParents($role)
{
$roleId = $this->get($role)->getRoleId();

return $this->_roles[$roleId]['parents'];
}

/**
* Returns true if and only if $role inherits from $inherit
*
* Both parameters may be either a Role or a Role identifier. If
* $onlyParents is true, then $role must inherit directly from
* $inherit in order to return true. By default, this method looks
* through the entire inheritance DAG to determine whether $role
* inherits from $inherit through its ancestor Roles.
*
* @param Zend_Acl_Role_Interface|string $role
* @param Zend_Acl_Role_Interface|string $inherit
* @param boolean $onlyParents
* @throws Zend_Acl_Role_Registry_Exception
* @return boolean
*/
public function inherits($role, $inherit, $onlyParents = false)
{
/**
* @see Zend_Acl_Role_Registry_Exception
*/
require_once 'Zend/Acl/Role/Registry/Exception.php';
try {
$roleId = $this->get($role)->getRoleId();
$inheritId = $this->get($inherit)->getRoleId();
} catch (Zend_Acl_Role_Registry_Exception $e) {
throw $e;
}

$inherits = isset($this->_roles[$roleId]['parents'][$inheritId]);

if ($inherits || $onlyParents) {
return $inherits;
}

foreach ($this->_roles[$roleId]['parents'] as $parentId => $parent) {
if ($this->inherits($parentId, $inheritId)) {
return true;
}
}

return false;
}

/**
* Removes the Role from the registry
*
* The $role parameter can either be a Role or a Role identifier.
*
* @param Zend_Acl_Role_Interface|string $role
* @throws Zend_Acl_Role_Registry_Exception
* @return Zend_Acl_Role_Registry Provides a fluent interface
*/
public function remove($role)
{
/**
* @see Zend_Acl_Role_Registry_Exception
*/
require_once 'Zend/Acl/Role/Registry/Exception.php';
try {
$roleId = $this->get($role)->getRoleId();
} catch (Zend_Acl_Role_Registry_Exception $e) {
throw $e;
}

foreach ($this->_roles[$roleId]['children'] as $childId => $child) {
unset($this->_roles[$childId]['parents'][$roleId]);
}
foreach ($this->_roles[$roleId]['parents'] as $parentId => $parent) {
unset($this->_roles[$parentId]['children'][$roleId]);
}

unset($this->_roles[$roleId]);

return $this;
}

/**
* Removes all Roles from the registry
*
* @return Zend_Acl_Role_Registry Provides a fluent interface
*/
public function removeAll()
{
$this->_roles = array();

return $this;
}

}

View File

@ -0,0 +1,36 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 8861 2008-03-16 14:30:18Z thomas $
*/


/**
* @see Zend_Acl_Exception
*/
require_once 'Zend/Acl/Exception.php';


/**
* @category Zend
* @package Zend_Acl
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Acl_Role_Registry_Exception extends Zend_Acl_Exception
{}

View File

@ -0,0 +1,79 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* The following constants are used throughout serialization and
* deserialization to detect the AMF marker and encoding types.
*
* @package Zend_Amf
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
final class Zend_Amf_Constants
{
const AMF0_NUMBER = 0x00;
const AMF0_BOOLEAN = 0x01;
const AMF0_STRING = 0x02;
const AMF0_OBJECT = 0x03;
const AMF0_MOVIECLIP = 0x04;
const AMF0_NULL = 0x05;
const AMF0_UNDEFINED = 0x06;
const AMF0_REFERENCE = 0x07;
const AMF0_MIXEDARRAY = 0x08;
const AMF0_OBJECTTERM = 0x09;
const AMF0_ARRAY = 0x0a;
const AMF0_DATE = 0x0b;
const AMF0_LONGSTRING = 0x0c;
const AMF0_UNSUPPORTED = 0x0e;
const AMF0_XML = 0x0f;
const AMF0_TYPEDOBJECT = 0x10;
const AMF0_AMF3 = 0x11;
const AMF0_OBJECT_ENCODING = 0x00;

const AMF3_UNDEFINED = 0x00;
const AMF3_NULL = 0x01;
const AMF3_BOOLEAN_FALSE = 0x02;
const AMF3_BOOLEAN_TRUE = 0x03;
const AMF3_INTEGER = 0x04;
const AMF3_NUMBER = 0x05;
const AMF3_STRING = 0x06;
const AMF3_XML = 0x07;
const AMF3_DATE = 0x08;
const AMF3_ARRAY = 0x09;
const AMF3_OBJECT = 0x0A;
const AMF3_XMLSTRING = 0x0B;
const AMF3_BYTEARRAY = 0x0C;
const AMF3_OBJECT_ENCODING = 0x03;

// Object encodings for AMF3 object types
const ET_PROPLIST = 0x00;
const ET_EXTERNAL = 0x01;
const ET_DYNAMIC = 0x02;
const ET_PROXY = 0x03;

/**
* Special content length value that indicates "unknown" content length
* per AMF Specification
*/
const UNKNOWN_CONTENT_LENGTH = -1;
const URL_APPEND_HEADER = 'AppendToGatewayUrl';
const RESULT_METHOD = '/onResult';
const STATUS_METHOD = '/onStatus';
}

View File

@ -0,0 +1,33 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* Zend_Exception
*/
require_once 'Zend/Exception.php';

/**
* @package Zend_Amf
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Exception extends Zend_Exception
{
}

View File

@ -0,0 +1,321 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Parse_Amf0
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Amf_Parse_Deserializer */
require_once 'Zend/Amf/Parse/Deserializer.php';

/**
* Read an AMF0 input stream and convert it into PHP data types
*
* @todo Implement Typed Object Class Mapping
* @todo Class could be implmented as Factory Class with each data type it's own class
* @package Zend_Amf
* @subpackage Parse_Amf0
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_Amf0_Deserializer extends Zend_Amf_Parse_Deserializer
{
/**
* An array of objects used for recursivly deserializing an object.
* @var array
*/
protected $_reference = array();

/**
* If AMF3 serialization occurs, update to AMF0 0x03
*
* @var int
*/
protected $_objectEncoding = Zend_Amf_Constants::AMF0_OBJECT_ENCODING;

/**
* refrence to AMF3 deserializer
*
* @var Zend_Amf_Parse_Amf3_Deserializer
*/
protected $_deserializer = null;

/**
* Read AMF markers and dispatch for deserialization
*
* Checks for AMF marker types and calls the appropriate methods
* for deserializing those marker types. Markers are the data type of
* the following value.
*
* @param integer $typeMarker
* @return mixed whatever the data type is of the marker in php
* @return mixed
* @throws Zend_Amf_Exception for invalid type
*/
public function readTypeMarker($typeMarker = null)
{
if (is_null($typeMarker)) {
$typeMarker = $this->_stream->readByte();
}

switch($typeMarker) {
// number
case Zend_Amf_Constants::AMF0_NUMBER:
return $this->_stream->readDouble();

// boolean
case Zend_Amf_Constants::AMF0_BOOLEAN:
return (boolean) $this->_stream->readByte();

// string
case Zend_Amf_Constants::AMF0_STRING:
return $this->_stream->readUTF();

// object
case Zend_Amf_Constants::AMF0_OBJECT:
return $this->readObject();

// null
case Zend_Amf_Constants::AMF0_NULL:
return null;

// undefined
case Zend_Amf_Constants::AMF0_UNDEFINED:
return null;

// Circular references are returned here
case Zend_Amf_Constants::AMF0_REFERENCE:
return $this->readReference();

// mixed array with numeric and string keys
case Zend_Amf_Constants::AMF0_MIXEDARRAY:
return $this->readMixedArray();

// array
case Zend_Amf_Constants::AMF0_ARRAY:
return $this->readArray();

// date
case Zend_Amf_Constants::AMF0_DATE:
return $this->readDate();

// longString strlen(string) > 2^16
case Zend_Amf_Constants::AMF0_LONGSTRING:
return $this->_stream->readLongUTF();

//internal AS object, not supported
case Zend_Amf_Constants::AMF0_UNSUPPORTED:
return null;

// XML
case Zend_Amf_Constants::AMF0_XML:
return $this->readXmlString();

// typed object ie Custom Class
case Zend_Amf_Constants::AMF0_TYPEDOBJECT:
return $this->readTypedObject();

//AMF3-specific
case Zend_Amf_Constants::AMF0_AMF3:
return $this->readAmf3TypeMarker();

default:
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Unsupported marker type: ' . $typeMarker);
}
}

/**
* Read AMF objects and convert to PHP objects
*
* Read the name value pair objects form the php message and convert them to
* a php object class.
*
* Called when the marker type is 3.
*
* @param array|null $object
* @return object
*/
public function readObject($object = null)
{
if (is_null($object)) {
$object = array();
}

while (true) {
$key = $this->_stream->readUTF();
$typeMarker = $this->_stream->readByte();
if ($typeMarker != Zend_Amf_Constants::AMF0_OBJECTTERM ){
//Recursivly call readTypeMarker to get the types of properties in the object
$object[$key] = $this->readTypeMarker($typeMarker);
} else {
//encountered AMF object terminator
break;
}
}
$this->_reference[] = $object;
return (object) $object;
}

/**
* Read reference objects
*
* Used to gain access to the private array of refrence objects.
* Called when marker type is 7.
*
* @return object
* @throws Zend_Amf_Exception for invalid reference keys
*/
public function readReference()
{
$key = $this->_stream->readInt();
if (!array_key_exists($key, $this->_reference)) {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Invalid reference key: '. $key);
}
return $this->_reference[$key];
}

/**
* Reads an array with numeric and string indexes.
*
* Called when marker type is 8
*
* @todo As of Flash Player 9 there is not support for mixed typed arrays
* so we handle this as an object. With the introduction of vectors
* in Flash Player 10 this may need to be reconsidered.
* @return array
*/
public function readMixedArray()
{
$length = $this->_stream->readLong();
return $this->readObject();
}

/**
* Converts numberically indexed actiosncript arrays into php arrays.
*
* Called when marker type is 10
*
* @return array
*/
public function readArray()
{
$length = $this->_stream->readLong();
$array = array();
while ($length--) {
$array[] = $this->readTypeMarker();
}
return $array;
}

/**
* Convert AS Date to Zend_Date
*
* @return Zend_Date
*/
public function readDate()
{
// get the unix time stamp. Not sure why ActionScript does not use
// milliseconds
$timestamp = floor($this->_stream->readDouble() / 1000);

// The timezone offset is never returned to the server; it is always 0,
// so read and ignore.
$offset = $this->_stream->readInt();

require_once 'Zend/Date.php';
$date = new Zend_Date($timestamp);
return $date;
}

/**
* Convert XML to SimpleXml
* If user wants DomDocument they can use dom_import_simplexml
*
* @return SimpleXml Object
*/
public function readXmlString()
{
$string = $this->_stream->readLongUTF();
return simplexml_load_string($string);
}

/**
* Read Class that is to be mapped to a server class.
*
* Commonly used for Value Objects on the server
*
* @todo implement Typed Class mapping
* @return object
* @throws Zend_Amf_Exception if unable to load type
*/
public function readTypedObject()
{
require_once 'Zend/Amf/Parse/TypeLoader.php';
// get the remote class name
$className = $this->_stream->readUTF();
$loader = Zend_Amf_Parse_TypeLoader::loadType($className);
$returnObject = new $loader();
$properties = get_object_vars($this->readObject());
foreach($properties as $key=>$value) {
if($key) {
$returnObject->$key = $value;
}
}

return $returnObject;
}

/**
* AMF3 data type encountered load AMF3 Deserializer to handle
* type markers.
*
* @return string
*/
public function readAmf3TypeMarker()
{
$deserializer = $this->getDeserializer();
$this->_objectEncoding = Zend_Amf_Constants::AMF3_OBJECT_ENCODING;
return $deserializer->readTypeMarker();
}

/**
* Return the object encoding to check if an AMF3 object
* is going to be return.
*
* @return int
*/
public function getObjectEncoding()
{
return $this->_objectEncoding;
}

/**
* Get deserializer
*
* @return Zend_Amf_Parse_Amf3_Deserializer
*/
public function getDeserializer()
{
if (null === $this->_deserializer) {
require_once 'Zend/Amf/Parse/Amf3/Deserializer.php';
$this->_deserializer = new Zend_Amf_Parse_Amf3_Deserializer($this->_stream);
}
return $this->_deserializer;
}
}

View File

@ -0,0 +1,289 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Parse_Amf0
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Amf_Parse_Serializer */
require_once 'Zend/Amf/Parse/Serializer.php';

/**
* Serializer php misc types back to there corresponding AMF0 Type Marker.
*
* @uses Zend_Amf_Parse_Serializer
* @package Zend_Amf
* @subpackage Parse_Amf0
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_Amf0_Serializer extends Zend_Amf_Parse_Serializer
{
/**
* @var string Name of the class to be returned
*/
protected $_className = '';

/**
* Determine type and serialize accordingly
*
* Checks to see if the type was declared and then either
* auto negotiates the type or relies on the user defined markerType to
* serialize the data into amf
*
* @param misc $data
* @param misc $markerType
* @return Zend_Amf_Parse_Amf0_Serializer
* @throws Zend_Amf_Exception for unrecognized types or data
*/
public function writeTypeMarker($data, $markerType = null)
{
if (null !== $markerType) {
// Write the Type Marker to denote the following action script data type
$this->_stream->writeByte($markerType);
switch($markerType) {
case Zend_Amf_Constants::AMF0_NUMBER:
$this->_stream->writeDouble($data);
break;
case Zend_Amf_Constants::AMF0_BOOLEAN:
$this->_stream->writeByte($data);
break;
case Zend_Amf_Constants::AMF0_STRING:
$this->_stream->writeUTF($data);
break;
case Zend_Amf_Constants::AMF0_OBJECT:
$this->writeObject($data);
break;
case Zend_Amf_Constants::AMF0_NULL:
break;
case Zend_Amf_Constants::AMF0_MIXEDARRAY:
// Write length of numeric keys as zero.
$this->_stream->writeLong(0);
$this->writeObject($data);
break;
case Zend_Amf_Constants::AMF0_ARRAY:
$this->writeArray($data);
break;
case Zend_Amf_Constants::AMF0_DATE:
$this->writeDate($data);
break;
case Zend_Amf_Constants::AMF0_LONGSTRING:
$this->_stream->writeLongUTF($data);
break;
case Zend_Amf_Constants::AMF0_TYPEDOBJECT:
$this->writeTypedObject($data);
break;
case Zend_Amf_Constants::AMF0_AMF3:
$this->writeAmf3TypeMarker($data);
break;
default:
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception("Unknown Type Marker: " . $markerType);
}
} else {
switch (true) {
case (is_int($data) || is_float($data)):
$markerType = Zend_Amf_Constants::AMF0_NUMBER;
break;
case (is_bool($data)):
$markerType = Zend_Amf_Constants::AMF0_BOOLEAN;
break;
case (is_string($data) && (strlen($data) > 65536)):
$markerType = Zend_Amf_Constants::AMF0_LONGSTRING;
break;
case (is_string($data)):
$markerType = Zend_Amf_Constants::AMF0_STRING;
break;
case (is_object($data)):
if (($data instanceof DateTime) || ($data instanceof Zend_Date)) {
$markerType = Zend_Amf_Constants::AMF0_DATE;
} else {

if($className = $this->getClassName($data)){
//Object is a Typed object set classname
$markerType = Zend_Amf_Constants::AMF0_TYPEDOBJECT;
$this->_className = $className;
} else {
// Object is a generic classname
$markerType = Zend_Amf_Constants::AMF0_OBJECT;
}
break;
}
break;
case (null === $data):
$markerType = Zend_Amf_Constants::AMF0_NULL;
break;
case (is_array($data)):
// check if it is a mixed typed array
foreach (array_keys($data) as $key) {
if (!is_numeric($key)) {
$markerType = Zend_Amf_Constants::AMF0_MIXEDARRAY;
break;
}
}
// Dealing with a standard numeric array
if(!$markerType){
$markerType = Zend_Amf_Constants::AMF0_ARRAY;
break;
}
break;
default:
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Unsupported data type: ' . gettype($data));
}

$this->writeTypeMarker($data, $markerType);
}
return $this;
}

/**
* Write a php array with string or mixed keys.
*
* @param object $data
* @return Zend_Amf_Parse_Amf0_Serializer
*/
public function writeObject($object)
{
// Loop each element and write the name of the property.
foreach ($object as $key => $value) {
$this->_stream->writeUTF($key);
$this->writeTypeMarker($value);
}

// Write the end object flag
$this->_stream->writeInt(0);
$this->_stream->writeByte(Zend_Amf_Constants::AMF0_OBJECTTERM);
return $this;
}

/**
* Write a standard numeric array to the output stream. If a mixed array
* is encountered call writeTypeMarker with mixed array.
*
* @param array $array
* @return Zend_Amf_Parse_Amf0_Serializer
*/
public function writeArray($array)
{
$length = count($array);
if (!$length < 0) {
// write the length of the array
$this->_stream->writeLong(0);
} else {
// Write the length of the numberic array
$this->_stream->writeLong($length);
for ($i=0; $i<$length; $i++) {
$value = isset($array[$i]) ? $array[$i] : null;
$this->writeTypeMarker($value);
}
}
return $this;
}

/**
* Convert the DateTime into an AMF Date
*
* @param DateTime|Zend_Date $data
* @return Zend_Amf_Parse_Amf0_Serializer
*/
public function writeDate($data)
{
if ($data instanceof DateTime) {
$dateString = $data->format('U');
} elseif ($data instanceof Zend_Date) {
$dateString = $data->toString('U');
} else {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Invalid date specified; must be a DateTime or Zend_Date object');
}
$dateString *= 1000;

// Make the conversion and remove milliseconds.
$this->_stream->writeDouble($dateString);

// Flash does not respect timezone but requires it.
$this->_stream->writeInt(0);

return $this;
}

/**
* Write a class mapped object to the output stream.
*
* @param object $data
* @return Zend_Amf_Parse_Amf0_Serializer
*/
public function writeTypedObject($data)
{
$this->_stream->writeUTF($this->_className);
$this->writeObject($data);
return $this;
}

/**
* Encountered and AMF3 Type Marker use AMF3 serializer. Once AMF3 is
* enountered it will not return to AMf0.
*
* @param string $data
* @return Zend_Amf_Parse_Amf0_Serializer
*/
public function writeAmf3TypeMarker($data)
{
require_once 'Zend/Amf/Parse/Amf3/Serializer.php';
$serializer = new Zend_Amf_Parse_Amf3_Serializer($this->_stream);
$serializer->writeTypeMarker($data);
return $this;
}

/**
* Find if the class name is a class mapped name and return the
* respective classname if it is.
*
* @param object $object
* @return false|string $className
*/
protected function getClassName($object)
{
require_once 'Zend/Amf/Parse/TypeLoader.php';
//Check to see if the object is a typed object and we need to change
$className = '';
switch (true) {
// the return class mapped name back to actionscript class name.
case Zend_Amf_Parse_TypeLoader::getMappedClassName(get_class($object)):
$className = Zend_Amf_Parse_TypeLoader::getMappedClassName(get_class($object));
break;
// Check to see if the user has defined an explicit Action Script type.
case isset($object->_explicitType):
$className = $object->_explicitType;
unset($object->_explicitType);
break;
// Check if user has defined a method for accessing the Action Script type
case method_exists($object, 'getASClassName'):
$className = $object->getASClassName();
break;
// No return class name is set make it a generic object
default:
break;
}
if(!$className == '') {
return $className;
} else {
return false;
}
}
}

View File

@ -0,0 +1,410 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Parse_Amf3
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Amf_Parse_Deserializer */
require_once 'Zend/Amf/Parse/Deserializer.php';

/** Zend_Amf_Parse_TypeLoader */
require_once 'Zend/Amf/Parse/TypeLoader.php';

/**
* Read an AMF3 input stream and convert it into PHP data types.
*
* @todo readObject to handle Typed Objects
* @todo readXMLStrimg to be implemented.
* @todo Class could be implmented as Factory Class with each data type it's own class.
* @package Zend_Amf
* @subpackage Parse_Amf3
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_Amf3_Deserializer extends Zend_Amf_Parse_Deserializer
{
/**
* Total number of objects in the referenceObject array
* @var int
*/
protected $_objectCount;

/**
* An array of reference objects per amf body
* @var array
*/
protected $_referenceObjects = array();

/**
* An array of reference strings per amf body
* @var array
*/
protected $_referenceStrings = array();

/**
* An array of reference class definitions per body
* @var array
*/
protected $_referenceDefinitions = array();

/**
* Read AMF markers and dispatch for deserialization
*
* Checks for AMF marker types and calls the appropriate methods
* for deserializing those marker types. markers are the data type of
* the following value.
*
* @param integer $typeMarker
* @return mixed Whatever the corresponding PHP data type is
* @throws Zend_Amf_Exception for unidentified marker type
*/
public function readTypeMarker($typeMarker = null)
{
if(null === $typeMarker) {
$typeMarker = $this->_stream->readByte();
}

switch($typeMarker) {
case Zend_Amf_Constants::AMF3_UNDEFINED:
return null;
case Zend_Amf_Constants::AMF3_NULL:
return null;
case Zend_Amf_Constants::AMF3_BOOLEAN_FALSE:
return false;
case Zend_Amf_Constants::AMF3_BOOLEAN_TRUE:
return true;
case Zend_Amf_Constants::AMF3_INTEGER:
return $this->readInteger();
case Zend_Amf_Constants::AMF3_NUMBER:
return $this->_stream->readDouble();
case Zend_Amf_Constants::AMF3_STRING:
return $this->readString();
case Zend_Amf_Constants::AMF3_DATE:
return $this->readDate();
case Zend_Amf_Constants::AMF3_ARRAY:
return $this->readArray();
case Zend_Amf_Constants::AMF3_OBJECT:
return $this->readObject();
case Zend_Amf_Constants::AMF3_XML:
case Zend_Amf_Constants::AMF3_XMLSTRING:
return $this->readXmlString();
case Zend_Amf_Constants::AMF3_BYTEARRAY:
return $this->readString();
default:
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Unsupported type marker: ' . $typeMarker);
}
}

/**
* Read and deserialize an integer
*
* AMF 3 represents smaller integers with fewer bytes using the most
* significant bit of each byte. The worst case uses 32-bits
* to represent a 29-bit number, which is what we would have
* done with no compression.
* - 0x00000000 - 0x0000007F : 0xxxxxxx
* - 0x00000080 - 0x00003FFF : 1xxxxxxx 0xxxxxxx
* - 0x00004000 - 0x001FFFFF : 1xxxxxxx 1xxxxxxx 0xxxxxxx
* - 0x00200000 - 0x3FFFFFFF : 1xxxxxxx 1xxxxxxx 1xxxxxxx xxxxxxxx
* - 0x40000000 - 0xFFFFFFFF : throw range exception
*
*
* 0x04 -> integer type code, followed by up to 4 bytes of data.
*
* @see: Parsing integers on OSFlash {http://osflash.org/amf3/parsing_integers>} for the AMF3 integer data format.
* @return int|float
*/
public function readInteger()
{
$count = 1;
$intReference = $this->_stream->readByte();
$result = 0;
while ((($intReference & 0x80) != 0) && $count < 4) {
$result <<= 7;
$result |= ($intReference & 0x7f);
$intReference = $this->_stream->readByte();
$count++;
}
if ($count < 4) {
$result <<= 7;
$result |= $intReference;
} else {
// Use all 8 bits from the 4th byte
$result <<= 8;
$result |= $intReference;

// Check if the integer should be negative
if (($result & 0x10000000) != 0) {
//and extend the sign bit
$result |= 0xe0000000;
}
}
return $result;
}

/**
* Read and deserialize a string
*
* Strings can be sent as a reference to a previously
* occurring String by using an index to the implicit string reference table.
* Strings are encoding using UTF-8 - however the header may either
* describe a string literal or a string reference.
*
* - string = 0×06 string-data
* - string-data = integer-data [ modified-utf-8 ]
* - modified-utf-8 = *OCTET
*
* @return String
*/
public function readString()
{
$stringReference = $this->readInteger();

//Check if this is a reference string
if (($stringReference & 0x01) == 0) {
// reference string
$stringReference = $stringReference >> 1;
if ($stringReference >= count($this->_referenceStrings)) {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Undefined string reference: ' . $stringReference);
}
// reference string found
return $this->_referenceStrings[$stringReference];
}

$length = $stringReference >> 1;
if ($length) {
$string = $this->_stream->readBytes($length);
$this->_referenceStrings[] = $string;
} else {
$string = "";
}
return $string;
}

/**
* Read and deserialize a date
*
* Data is the number of milliseconds elapsed since the epoch
* of midnight, 1st Jan 1970 in the UTC time zone.
* Local time zone information is not sent to flash.
*
* - date = 0×08 integer-data [ number-data ]
*
* @return Zend_Date
*/
public function readDate()
{
$dateReference = $this->readInteger();
if (($dateReference & 0x01) == 0) {
$dateReference = $dateReference >> 1;
if ($dateReference>=count($this->_referenceObjects)) {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Undefined date reference: ' . $dateReference);
}
return $this->_referenceObjects[$dateReference];
}

$timestamp = floor($this->_stream->readDouble() / 1000);

require_once 'Zend/Date.php';
$dateTime = new Zend_Date((int) $timestamp);
$this->_referenceObjects[] = $dateTime;
return $dateTime;
}

/**
* Read amf array to PHP array
*
* - array = 0×09 integer-data ( [ 1OCTET *amf3-data ] | [OCTET *amf3-data 1] | [ OCTET *amf-data ] )
*
* @return array
*/
public function readArray()
{
$arrayReference = $this->readInteger();
if (($arrayReference & 0x01)==0){
$arrayReference = $arrayReference >> 1;
if ($arrayReference>=count($this->_referenceObjects)) {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Unknow array reference: ' . $arrayReference);
}
return $this->_referenceObjects[$arrayReference];
}

// Create a holder for the array in the reference list
$data = array();
$this->_referenceObjects[] &= $data;
$key = $this->readString();

// Iterating for string based keys.
while ($key != '') {
$data[$key] = $this->readTypeMarker();
$key = $this->readString();
}

$arrayReference = $arrayReference >>1;

//We have a dense array
for ($i=0; $i < $arrayReference; $i++) {
$data[] = $this->readTypeMarker();
}

return $data;
}

/**
* Read an object from the AMF stream and convert it into a PHP object
*
* @todo Rather than using an array of traitsInfo create Zend_Amf_Value_TraitsInfo
* @return object
*/
public function readObject()
{
$traitsInfo = $this->readInteger();
$storedObject = ($traitsInfo & 0x01)==0;
$traitsInfo = $traitsInfo >> 1;

// Check if the Object is in the stored Objects reference table
if ($storedObject) {
$ref = $traitsInfo;
if (!isset($this->_referenceObjects[$ref])) {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Unknown Object reference: ' . $ref);
}
$returnObject = $this->_referenceObjects[$ref];
} else {
// Check if the Object is in the stored Definistions reference table
$storedClass = ($traitsInfo & 0x01) == 0;
$traitsInfo = $traitsInfo >> 1;
if ($storedClass) {
$ref = $traitsInfo;
if (!isset($this->_referenceDefinitions[$ref])) {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Unknows Definition reference: '. $ref);
}
// Populate the reference attributes
$className = $this->_referenceDefinitions[$ref]['className'];
$encoding = $this->_referenceDefinitions[$ref]['encoding'];
$propertyNames = $this->_referenceDefinitions[$ref]['propertyNames'];
} else {
// The class was not in the reference tables. Start reading rawdata to build traits.
// Create a traits table. Zend_Amf_Value_TraitsInfo would be ideal
$className = $this->readString();
$encoding = $traitsInfo & 0x03;
$propertyNames = array();
$traitsInfo = $traitsInfo >> 2;
}

// We now have the object traits defined in variables. Time to go to work:
if (!$className) {
// No class name generic object
$returnObject = new stdClass();
} else {
// Defined object
// Typed object lookup agsinst registered classname maps
if ($loader = Zend_Amf_Parse_TypeLoader::loadType($className)) {
$returnObject = new $loader();
} else {
//user defined typed object
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Typed object not found: '. $className . ' ');
}
}

// Add the Object ot the reference table
$this->_referenceObjects[] = $returnObject;

// Check encoding types for additional processing.
switch ($encoding) {
case (Zend_Amf_Constants::ET_EXTERNAL):
// Externalizable object such as {ArrayCollection} and {ObjectProxy}
if (!$storedClass) {
$this->_referenceDefinitions[] = array(
'className' => $className,
'encoding' => $encoding,
'propertyNames' => $propertyNames,
);
}
$returnObject->externalizedData = $this->readTypeMarker();
break;
case (Zend_Amf_Constants::ET_DYNAMIC):
// used for Name-value encoding
if (!$storedClass) {
$this->_referenceDefinitions[] = array(
'className' => $className,
'encoding' => $encoding,
'propertyNames' => $propertyNames,
);
}
// not a refrence object read name value properties from byte stream
$properties = array(); // clear value
do {
$property = $this->readString();
if ($property != "") {
$propertyNames[] = $property;
$properties[$property] = $this->readTypeMarker();
}
} while ($property !="");
break;
default:
// basic property list object.
if (!$storedClass) {
$count = $traitsInfo; // Number of properties in the list
for($i=0; $i< $count; $i++) {
$propertyNames[] = $this->readString();
}
// Add a refrence to the class.
$this->_referenceDefinitions[] = array(
'className' => $className,
'encoding' => $encoding,
'propertyNames' => $propertyNames,
);
}
$properties = array(); // clear value
foreach ($propertyNames as $property) {
$properties[$property] = $this->readTypeMarker();
}
break;
}

// Add properties back to the return object.
foreach($properties as $key=>$value) {
if($key) {
$returnObject->$key = $value;
}
}
}
return $returnObject;
}

/**
* Convert XML to SimpleXml
* If user wants DomDocument they can use dom_import_simplexml
*
* @return SimpleXml Object
*/
public function readXmlString()
{
$xmlReference = $this->readInteger();
$length = $xmlReference >> 1;
$string = $this->_stream->readBytes($length);
return simplexml_load_string($string);
}
}

View File

@ -0,0 +1,317 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Parse_Amf3
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Amf_Parse_Serializer */
require_once 'Zend/Amf/Parse/Serializer.php';

/** Zend_Amf_Parse_TypeLoader */
require_once 'Zend/Amf/Parse/TypeLoader.php';

/**
* Detect PHP object type and convert it to a corresponding AMF3 object type
*
* @package Zend_Amf
* @subpackage Parse_Amf3
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_Amf3_Serializer extends Zend_Amf_Parse_Serializer
{
/**
* Serialize PHP types to AMF3 and write to stream
*
* Checks to see if the type was declared and then either
* auto negotiates the type or use the user defined markerType to
* serialize the data from php back to AMF3
*
* @param mixed $content
* @param int $markerType
* @return void
*/
public function writeTypeMarker($data, $markerType=null)
{
if (null !== $markerType) {
// Write the Type Marker to denote the following action script data type
$this->_stream->writeByte($markerType);

switch ($markerType) {
case Zend_Amf_Constants::AMF3_NULL:
break;
case Zend_Amf_Constants::AMF3_BOOLEAN_FALSE:
break;
case Zend_Amf_Constants::AMF3_BOOLEAN_TRUE:
break;
case Zend_Amf_Constants::AMF3_INTEGER:
$this->writeInteger($data);
break;
case Zend_Amf_Constants::AMF3_NUMBER:
$this->_stream->writeDouble($data);
break;
case Zend_Amf_Constants::AMF3_STRING:
$this->writeString($data);
break;
case Zend_Amf_Constants::AMF3_DATE:
$this->writeDate($data);
break;
case Zend_Amf_Constants::AMF3_ARRAY:
$this->writeArray($data);
break;
case Zend_Amf_Constants::AMF3_OBJECT:
$this->writeObject($data);
break;
case Zend_Amf_Constants::AMF3_BYTEARRAY:
$this->writeString($data);
break;
default:
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Unknown Type Marker: ' . $markerType);
}
} else {
// Detect Type Marker
switch (true) {
case (null === $data):
$markerType = Zend_Amf_Constants::AMF3_NULL;
break;
case (is_bool($data)):
if ($data){
$markerType = Zend_Amf_Constants::AMF3_BOOLEAN_TRUE;
} else {
$markerType = Zend_Amf_Constants::AMF3_BOOLEAN_FALSE;
}
break;
case (is_int($data)):
if (($data > 0xFFFFFFF) || ($data < -268435456)) {
$markerType = Zend_Amf_Constants::AMF3_NUMBER;
} else {
$markerType = Zend_Amf_Constants::AMF3_INTEGER;
}
break;
case (is_float($data)):
$markerType = Zend_Amf_Constants::AMF3_NUMBER;
break;
case (is_string($data)):
$markerType = Zend_Amf_Constants::AMF3_STRING;
break;
case (is_array($data)):
$markerType = Zend_Amf_Constants::AMF3_ARRAY;
break;
case (is_object($data)):
// Handle object types.
if (($data instanceof DateTime) || ($data instanceof Zend_Date)) {
$markerType = Zend_Amf_Constants::AMF3_DATE;
} else if ($data instanceof Zend_Amf_Value_ByteArray) {
$markerType = Zend_Amf_Constants::AMF3_BYTEARRAY;
} else {
$markerType = Zend_Amf_Constants::AMF3_OBJECT;
}
break;
default:
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Unsupported data type: ' . gettype($data));
}
$this->writeTypeMarker($data, $markerType);
}
}

/**
* Write an AMF3 integer
*
* @param int|float $data
* @return Zend_Amf_Parse_Amf3_Serializer
*/
public function writeInteger($int)
{
if (($int & 0xffffff80) == 0) {
$this->_stream->writeByte($int & 0x7f);
return $this;
}

if (($int & 0xffffc000) == 0 ) {
$this->_stream->writeByte(($int >> 7 ) | 0x80);
$this->_stream->writeByte($int & 0x7f);
return $this;
}

if (($int & 0xffe00000) == 0) {
$this->_stream->writeByte(($int >> 14 ) | 0x80);
$this->_stream->writeByte(($int >> 7 ) | 0x80);
$this->_stream->writeByte($int & 0x7f);
return $this;
}

$this->_stream->writeByte(($int >> 22 ) | 0x80);
$this->_stream->writeByte(($int >> 15 ) | 0x80);
$this->_stream->writeByte(($int >> 8 ) | 0x80);
$this->_stream->writeByte($int & 0xff);
return $this;
}

/**
* Send string to output stream
*
* @param string $string
* @return Zend_Amf_Parse_Amf3_Serializer
*/
public function writeString($string)
{
$ref = strlen($string) << 1 | 0x01;
$this->writeInteger($ref);
$this->_stream->writeBytes($string);
return $this;
}

/**
* Convert DateTime/Zend_Date to AMF date
*
* @param DateTime|Zend_Date $date
* @return Zend_Amf_Parse_Amf3_Serializer
*/
public function writeDate($date)
{
if ($date instanceof DateTime) {
$dateString = $date->format('U') * 1000;
} elseif ($date instanceof Zend_Date) {
$dateString = $date->toString('U') * 1000;
} else {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Invalid date specified; must be a string DateTime or Zend_Date object');
}

$this->writeInteger(0x01);
// write time to stream minus milliseconds
$this->_stream->writeDouble($dateString);
return $this;
}

/**
* Write a PHP array back to the amf output stream
*
* @param array $array
* @return Zend_Amf_Parse_Amf3_Serializer
*/
public function writeArray(array $array)
{
// have to seperate mixed from numberic keys.
$numeric = array();
$string = array();
foreach ($array as $key => $value) {
if (is_int($key)) {
$numeric[] = $value;
} else {
$string[$key] = $value;
}
}

// write the preamble id of the array
$length = count($numeric);
$id = ($length << 1) | 0x01;
$this->writeInteger($id);

//Write the mixed type array to the output stream
foreach($string as $key => $value) {
$this->writeString($key)
->writeTypeMarker($value);
}
$this->writeString('');

// Write the numeric array to ouput stream
foreach($numeric as $value) {
$this->writeTypeMarker($value);
}
return $this;
}

/**
* Write object to ouput stream
*
* @param mixed $data
* @return Zend_Amf_Parse_Amf3_Serializer
*/
public function writeObject($object)
{
$encoding = Zend_Amf_Constants::ET_PROPLIST;
$className = '';

//Check to see if the object is a typed object and we need to change
switch (true) {
// the return class mapped name back to actionscript class name.
case ($className = Zend_Amf_Parse_TypeLoader::getMappedClassName(get_class($object))):
break;

// Check to see if the user has defined an explicit Action Script type.
case isset($object->_explicitType):
$className = $object->_explicitType;
unset($object->_explicitType);
break;

// Check if user has defined a method for accessing the Action Script type
case method_exists($object, 'getASClassName'):
$className = $object->getASClassName();
break;

// No return class name is set make it a generic object
default:
break;
}

$traitsInfo = Zend_Amf_Constants::AMF3_OBJECT_ENCODING;
$traitsInfo |= $encoding << 2;
try {
switch($encoding) {
case Zend_Amf_Constants::ET_PROPLIST:
$count = 0;
foreach($object as $key => $value) {
$count++;
}
$traitsInfo |= ($count << 4);

// Write the object ID
$this->writeInteger($traitsInfo);

// Write the classname
$this->writeString($className);

// Write the object Key's to the output stream
foreach ($object as $key => $value) {
$this->writeString($key);
}

//Write the object values to the output stream.
foreach ($object as $key => $value) {
$this->writeTypeMarker($value);
}
break;
case Zend_Amf_Constants::ET_EXTERNAL:
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('External Object Encoding not implemented');
break;
default:
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Unknown Object Encoding type: ' . $encoding);
}
} catch (Exception $e) {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Unable to writeObject output: ' . $e->getMessage());
}

return $this;
}
}

View File

@ -0,0 +1,64 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* Abstract cass that all deserializer must implement.
*
* Logic for deserialization of the AMF envelop is based on resources supplied
* by Adobe Blaze DS. For and example of deserialization please review the BlazeDS
* source tree.
*
* @see http://opensource.adobe.com/svn/opensource/blazeds/trunk/modules/core/src/java/flex/messaging/io/amf/
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Amf_Parse_Deserializer
{
/**
* The raw string that represents the AMF request.
*
* @var Zend_Amf_Parse_InputStream
*/
protected $_stream;

/**
* Constructor
*
* @param Zend_Amf_Parse_InputStream $stream
* @return void
*/
public function __construct(Zend_Amf_Parse_InputStream $stream)
{
$this->_stream = $stream;
}

/**
* Checks for AMF marker types and calls the appropriate methods
* for deserializing those marker types. Markers are the data type of
* the following value.
*
* @param int $typeMarker
* @return mixed Whatever the data type is of the marker in php
*/
public abstract function readTypeMarker($markerType = null);
}

View File

@ -0,0 +1,38 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Amf_Util_BinaryStream */
require_once 'Zend/Amf/Util/BinaryStream.php';

/**
* InputStream is used to iterate at a binary level through the AMF request.
*
* InputStream extends BinaryStream as eventually BinaryStream could be placed
* outside of Zend_Amf in order to allow other packages to use the class.
*
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_InputStream extends Zend_Amf_Util_BinaryStream
{
}

View File

@ -0,0 +1,48 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Amf_Util_BinaryStream */
require_once 'Zend/Amf/Util/BinaryStream.php';

/**
* Iterate at a binary level through the AMF response
*
* OutputStream extends BinaryStream as eventually BinaryStream could be placed
* outside of Zend_Amf in order to allow other packages to use the class.
*
* @uses Zend_Amf_Util_BinaryStream
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Parse_OutputStream extends Zend_Amf_Util_BinaryStream
{
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct('');
}
}

View File

@ -0,0 +1,58 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* Base abstract class for all AMF serializers.
*
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Amf_Parse_Serializer
{
/**
* Refrence to the current output stream being constructed
*
* @var string
*/
protected $_stream;

/**
* Constructor
*
* @param Zend_Amf_Parse_OutputStream $stream
* @return void
*/
public function __construct(Zend_Amf_Parse_OutputStream $stream)
{
$this->_stream = $stream;
}

/**
* Find the PHP object type and convert it into an AMF object type
*
* @param mixed $content
* @param int $markerType
* @return void
*/
public abstract function writeTypeMarker($content, $markerType=null);
}

View File

@ -0,0 +1,133 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

require_once 'Zend/Amf/Value/Messaging/AcknowledgeMessage.php';
require_once 'Zend/Amf/Value/Messaging/AsyncMessage.php';
require_once 'Zend/Amf/Value/Messaging/CommandMessage.php';
require_once 'Zend/Amf/Value/Messaging/ErrorMessage.php';
require_once 'Zend/Amf/Value/Messaging/RemotingMessage.php';

/**
* Loads a local class and executes the instantiation of that class.
*
* @todo PHP 5.3 can drastically change this class w/ namespace and the new call_user_func w/ namespace
* @package Zend_Amf
* @subpackage Parse
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
final class Zend_Amf_Parse_TypeLoader
{
/**
* @var string callback class
*/
public static $callbackClass;

/**
* @var array AMF class map
*/
public static $classMap = array (
'flex.messaging.messages.AcknowledgeMessage' => 'Zend_Amf_Value_Messaging_AcknowledgeMessage',
'flex.messaging.messages.ErrorMessage' => 'Zend_Amf_Value_Messaging_AsyncMessage',
'flex.messaging.messages.CommandMessage' => 'Zend_Amf_Value_Messaging_CommandMessage',
'flex.messaging.messages.ErrorMessage' => 'Zend_Amf_Value_Messaging_ErrorMessage',
'flex.messaging.messages.RemotingMessage' => 'Zend_Amf_Value_Messaging_RemotingMessage',
);

/**
* @var array Default class map
*/
protected static $_defaultClassMap = array(
'flex.messaging.messages.AcknowledgeMessage' => 'Zend_Amf_Value_Messaging_AcknowledgeMessage',
'flex.messaging.messages.ErrorMessage' => 'Zend_Amf_Value_Messaging_AsyncMessage',
'flex.messaging.messages.CommandMessage' => 'Zend_Amf_Value_Messaging_CommandMessage',
'flex.messaging.messages.ErrorMessage' => 'Zend_Amf_Value_Messaging_ErrorMessage',
'flex.messaging.messages.RemotingMessage' => 'Zend_Amf_Value_Messaging_RemotingMessage',
);

/**
* Load the mapped class type into a callback.
*
* @param string $className
* @return object|false
*/
public static function loadType($className)
{
$class = false;
$callBack = false;
$class = self::getMappedClassName($className);
if (!class_exists($class)) {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception($className .' mapped class '. $class . ' is not defined');
}

return $class;
}

/**
* Looks up the supplied call name to its mapped class name
*
* @param string $className
* @return string
*/
public static function getMappedClassName($className)
{
$mappedName = array_search($className, self::$classMap);

if ($mappedName) {
return $mappedName;
}

$mappedName = array_search($className, array_flip(self::$classMap));

if ($mappedName) {
return $mappedName;
}

return false;
}

/**
* Map PHP class names to ActionScript class names
*
* Allows users to map the class names of there action script classes
* to the equivelent php class name. Used in deserialization to load a class
* and serialiation to set the class name of the returned object.
*
* @param string $asClassName
* @param string $phpClassName
* @return void
*/
public static function setMapping($asClassName, $phpClassName)
{
self::$classMap[$asClassName] = $phpClassName;
}

/**
* Reset type map
*
* @return void
*/
public static function resetMap()
{
self::$classMap = self::$_defaultClassMap;
}
}

249
libs/Zend/Amf/Request.php Normal file
View File

@ -0,0 +1,249 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Amf_Parse_InputStream */
require_once 'Zend/Amf/Parse/InputStream.php';

/** Zend_Amf_Parse_Amf0_Deserializer */
require_once 'Zend/Amf/Parse/Amf0/Deserializer.php';

/** Zend_Amf_Constants */
require_once 'Zend/Amf/Constants.php';

/** Zend_Amf_Value_MessageHeader */
require_once 'Zend/Amf/Value/MessageHeader.php';

/** Zend_Amf_Value_MessageBody */
require_once 'Zend/Amf/Value/MessageBody.php';

/**
* Handle the incoming AMF request by deserializing the data to php object
* types and storing the data for Zend_Amf_Server to handle for processing.
*
* @todo Currently not checking if the object needs to be Type Mapped to a server object.
* @package Zend_Amf
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Request
{
/**
* @var int AMF client type (AMF0, AMF3)
*/
protected $_clientType = 0; // default AMF0

/**
* @var array Message bodies
*/
protected $_bodies = array();

/**
* @var array Message headers
*/
protected $_headers = array();

/**
* @var int Message encoding to use for objects in response
*/
protected $_objectEncoding = 0;

/**
* @var Zend_Amf_Parse_InputStream
*/
protected $_inputStream;

/**
* @var Zend_Amf_Parse_AMF0_Deserializer
*/
protected $_deserializer;

/**
* Time of the request
* @var mixed
*/
protected $_time;

/**
* Prepare the AMF InputStream for parsing.
*
* @param string $request
* @return Zend_Amf_Request
*/
public function initialize($request)
{
$this->_inputStream = new Zend_Amf_Parse_InputStream($request);
$this->_deserializer = new Zend_Amf_Parse_AMF0_Deserializer($this->_inputStream);
$this->readMessage($this->_inputStream);
return $this;
}

/**
* Takes the raw AMF input stream and converts it into valid PHP objects
*
* @param Zend_Amf_Parse_InputStream
* @return Zend_Amf_Request
*/
public function readMessage(Zend_Amf_Parse_InputStream $stream)
{
$clientVersion = $stream->readUnsignedShort();
if (($clientVersion != Zend_Amf_Constants::AMF0_OBJECT_ENCODING)
&& ($clientVersion != Zend_Amf_Constants::AMF3_OBJECT_ENCODING)
) {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Unknown Player Version ' . $clientVersion);
}

$this->_bodies = array();
$this->_headers = array();
$headerCount = $stream->readInt();

// Iterate through the AMF envelope header
while ($headerCount--) {
$this->_headers[] = $this->readHeader();
}

// Iterate through the AMF envelope body
$bodyCount = $stream->readInt();
while ($bodyCount--) {
$this->_bodies[] = $this->readBody();
}

return $this;
}

/**
* Deserialize a message header from the input stream.
*
* A message header is structured as:
* - NAME String
* - MUST UNDERSTAND Boolean
* - LENGTH Int
* - DATA Object
*
* @return Zend_Amf_Value_MessageHeader
*/
public function readHeader()
{
$name = $this->_inputStream->readUTF();
$mustRead = (bool)$this->_inputStream->readByte();
$length = $this->_inputStream->readLong();

try {
$data = $this->_deserializer->readTypeMarker();
} catch (Exception $e) {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Unable to parse ' . $name . ' header data: ' . $e->getMessage() . ' '. $e->getLine());
}

$header = new Zend_Amf_Value_MessageHeader($name, $mustRead, $data, $length);
return $header;
}

/**
* Deserialize a message body from the input stream
*
* @return Zend_Amf_Value_MessageBody
*/
public function readBody()
{
$targetURI = $this->_inputStream->readUTF();
$responseURI = $this->_inputStream->readUTF();
$length = $this->_inputStream->readLong();

try {
$data = $this->_deserializer->readTypeMarker();
} catch (Exception $e) {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Unable to parse ' . $targetURI . ' body data ' . $e->getMessage());
}

// Check for AMF3 objectEncoding
if ($this->_deserializer->getObjectEncoding() == Zend_Amf_Constants::AMF3_OBJECT_ENCODING) {
/*
* When and AMF3 message is sent to the server it is nested inside
* an AMF0 array called Content. The following code gets the object
* out of the content array and sets it as the message data.
*/
if(is_array($data) && is_object($data[0])){
$data = $data[0];
}

// set the encoding so we return our message in AMF3
$this->_objectEncoding = Zend_Amf_Constants::AMF3_OBJECT_ENCODING;
}

$body = new Zend_Amf_Value_MessageBody($targetURI, $responseURI, $data);
return $body;
}

/**
* Return an array of the body objects that were found in the amf request.
*
* @return array {target, response, length, content}
*/
public function getAmfBodies()
{
return $this->_bodies;
}

/**
* Accessor to private array of message bodies.
*
* @param Zend_Amf_Value_MessageBody $message
* @return Zend_Amf_Request
*/
public function addAmfBody(Zend_Amf_Value_MessageBody $message)
{
$this->_bodies[] = $message;
return $this;
}

/**
* Return an array of headers that were found in the amf request.
*
* @return array {operation, mustUnderstand, length, param}
*/
public function getAmfHeaders()
{
return $this->_headers;
}

/**
* Return the either 0 or 3 for respect AMF version
*
* @return int
*/
public function getObjectEncoding()
{
return $this->_objectEncoding;
}

/**
* Set the object response encoding
*
* @param mixed $int
* @return Zend_Amf_Request
*/
public function setObjectEncoding($int)
{
$this->_objectEncoding = $int;
return $this;
}
}

View File

@ -0,0 +1,79 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Request
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Amf_Request */
require_once 'Zend/Amf/Request.php';

/**
* AMF Request object -- Request via HTTP
*
* Extends {@link Zend_Amf_Request} to accept a request via HTTP. Request is
* built at construction time using a raw POST; if no data is available, the
* request is declared a fault.
*
* @package Zend_Amf
* @subpackage Request
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Request_Http extends Zend_Amf_Request
{
/**
* Raw AMF request
* @var string
*/
protected $_rawRequest;

/**
* Constructor
*
* Attempts to read from php://input to get raw POST request; if an error
* occurs in doing so, or if the AMF body is invalid, the request is declared a
* fault.
*
* @return void
*/
public function __construct()
{
// php://input allows you to read raw POST data. It is a less memory
// intensive alternative to $HTTP_RAW_POST_DATA and does not need any
// special php.ini directives
$amfRequest = file_get_contents('php://input');

// Check to make sure that we have data on the input stream.
if ($amfRequest != '') {
$this->_rawRequest = $amfRequest;
$this->initialize($amfRequest);
} else {
echo '<p>Zend Amf Endpoint</p>' ;
}
}

/**
* Retrieve raw AMF Request
*
* @return string
*/
public function getRawRequest()
{
return $this->_rawRequest;
}
}

193
libs/Zend/Amf/Response.php Normal file
View File

@ -0,0 +1,193 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Amf_Constants */
require_once 'Zend/Amf/Constants.php';

/** Zend_Amf_Parse_OutputStream */
require_once 'Zend/Amf/Parse/OutputStream.php';

/** Zend_Amf_Parse_Amf0_Serializer */
require_once 'Zend/Amf/Parse/Amf0/Serializer.php';

/**
* Handles converting the PHP object ready for response back into AMF
*
* @package Zend_Amf
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Response
{
/**
* @var int Object encoding for response
*/
protected $_objectEncoding = 0;

/**
* Array of Zend_Amf_Value_MessageBody objects
* @var array
*/
protected $_bodies = array();

/**
* Array of Zend_Amf_Value_MessageHeader objects
* @var array
*/
protected $_headers = array();

/**
* @var Zend_Amf_Parse_OutputStream
*/
protected $_outputStream;

/**
* Instantiate new output stream and start serialization
*
* @return Zend_Amf_Response
*/
public function finalize()
{
$this->_outputStream = new Zend_Amf_Parse_OutputStream();
$this->writeMessage($this->_outputStream);
return $this;
}

/**
* Serialize the PHP data types back into Actionscript and
* create and AMF stream.
*
* @param Zend_Amf_Parse_OutputStream $stream
* @return Zend_Amf_Response
*/
public function writeMessage(Zend_Amf_Parse_OutputStream $stream)
{
$objectEncoding = $this->_objectEncoding;

//Write encoding to start of stream. Preamble byte is written of two byte Unsigned Short
$stream->writeByte(0x00);
$stream->writeByte($objectEncoding);

// Loop through the AMF Headers that need to be returned.
$headerCount = count($this->_headers);
$stream->writeInt($headerCount);
foreach ($this->getAmfHeaders() as $header) {
$serializer = new Zend_Amf_Parse_Amf0_Serializer($stream);
$stream->writeUTF($header->name);
$stream->writeByte($header->mustRead);
$stream->writeLong(Zend_Amf_Constants::UNKNOWN_CONTENT_LENGTH);
$serializer->writeTypeMarker($header->data);
}

// loop through the AMF bodies that need to be returned.
$bodyCount = count($this->_bodies);
$stream->writeInt($bodyCount);
foreach ($this->_bodies as $body) {
$serializer = new Zend_Amf_Parse_Amf0_Serializer($stream);
$stream->writeUTF($body->getTargetURI());
$stream->writeUTF($body->getResponseURI());
$stream->writeLong(Zend_Amf_Constants::UNKNOWN_CONTENT_LENGTH);
if($this->_objectEncoding == Zend_Amf_Constants::AMF0_OBJECT_ENCODING) {
$serializer->writeTypeMarker($body->getData());
} else {
// Content is AMF3
$serializer->writeTypeMarker($body->getData(),Zend_Amf_Constants::AMF0_AMF3);
}
}

return $this;
}

/**
* Return the output stream content
*
* @return string The contents of the output stream
*/
public function getResponse()
{
return $this->_outputStream->getStream();
}

/**
* Return the output stream content
*
* @return string
*/
public function __toString()
{
return $this->getResponse();
}

/**
* Add an AMF body to be sent to the Flash Player
*
* @param Zend_Amf_Value_MessageBody $body
* @return Zend_Amf_Response
*/
public function addAmfBody(Zend_Amf_Value_MessageBody $body)
{
$this->_bodies[] = $body;
return $this;
}

/**
* Return an array of AMF bodies to be serialized
*
* @return array
*/
public function getAmfBodies()
{
return $this->_bodies;
}

/**
* Add an AMF Header to be sent back to the flash player
*
* @param Zend_Amf_Value_MessageHeader $header
* @return Zend_Amf_Response
*/
public function addAmfHeader(Zend_Amf_Value_MessageHeader $header)
{
$this->_headers[] = $header;
return $this;
}

/**
* Retrieve attached AMF message headers
*
* @return array Array of Zend_Amf_Value_MessageHeader objects
*/
public function getAmfHeaders()
{
return $this->_headers;
}

/**
* Set the AMF encoding that will be used for serialization
*
* @param int $encoding
* @return Zend_Amf_Response
*/
public function setObjectEncoding($encoding)
{
$this->_objectEncoding = $encoding;
return $this;
}
}

View File

@ -0,0 +1,47 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Response
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Amf_Response */
require_once 'Zend/Amf/Response.php';

/**
* Creates the proper http headers and send the serialized AMF stream to standard out.
*
* @package Zend_Amf
* @subpackage Response
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Response_Http extends Zend_Amf_Response
{
/**
* Create the application response header for AMF and sends the serialized AMF string
*
* @return string
*/
public function getResponse()
{
if (!headers_sent()) {
header('Content-Type: application/x-amf');
}
return parent::getResponse();
}
}

627
libs/Zend/Amf/Server.php Normal file
View File

@ -0,0 +1,627 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Server_Interface */
require_once 'Zend/Server/Interface.php';

/** Zend_Server_Reflection */
require_once 'Zend/Server/Reflection.php';

/** Zend_Amf_Constants */
require_once 'Zend/Amf/Constants.php';

/** Zend_Amf_Value_MessageBody */
require_once 'Zend/Amf/Value/MessageBody.php';

/** Zend_Amf_Value_Messaging_CommandMessage */
require_once 'Zend/Amf/Value/Messaging/CommandMessage.php';

/**
* An AMF gateway server implementation to allow the connection of the Adobe Flash Player to
* the Zend Framework
*
* @todo Make the relection methods cache and autoload.
* @package Zend_Amf
* @subpackage Server
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Server implements Zend_Server_Interface
{
/**
* Array of dispatchables
* @var array
*/
protected $_methods = array();

/**
* Array of directories to search for loading classes dynamically
* @var array
*/
protected $_directories = array();

/**
* @var bool Production flag; whether or not to return exception messages
*/
protected $_production = true;

/**
* Request processed
* @var null|Zend_Amf_Request
*/
protected $_request = null;

/**
* Class to use for responses
* @var null|Zend_Amf_Response
*/
protected $_response;

/**
* Dispatch table of name => method pairs
* @var array
*/
protected $_table = array();

/**
* Set production flag
*
* @param bool $flag
* @return Zend_Amf_Server
*/
public function setProduction($flag)
{
$this->_production = (bool) $flag;
return $this;
}

/**
* Whether or not the server is in production
*
* @return bool
*/
public function isProduction()
{
return $this->_production;
}


/**
* Loads a remote class or method and executes the function and returns
* the result
*
* @param string $method Is the method to execute
* @param mixed $param values for the method
* @return mixed $response the result of executing the method
* @throws Zend_Amf_Server_Exception
*/
protected function _dispatch($method, $params = null, $source = null)
{
if (!isset($this->_table[$method])) {
// if source is null a method that was not defined was called.
if ($source) {
$classPath = array();
$path = explode('.', $source);
$className = array_pop($path);
$uriclasspath = implode('/', $path);

// Take the user supplied directories and add the unique service path to the end.
foreach ($this->_directories as $dir) {
$classPath[] = $dir . $uriclasspath;
}

require_once('Zend/Loader.php');
try {
Zend_Loader::loadClass($className, $classPath);
} catch (Exception $e) {
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Class "' . $className . '" does not exist');
}
// Add the new loaded class to the server.
$this->setClass($className);
} else {
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Method "' . $method . '" does not exist');
}
}

$info = $this->_table[$method];
$argv = $info->getInvokeArguments();
if (0 < count($argv)) {
$params = array_merge($params, $argv);
}

if ($info instanceof Zend_Server_Reflection_Function) {
$func = $info->getName();
$return = call_user_func_array($func, $params);
} elseif ($info instanceof Zend_Server_Reflection_Method) {
// Get class
$class = $info->getDeclaringClass()->getName();
if ('static' == $info->isStatic()) {
// for some reason, invokeArgs() does not work the same as
// invoke(), and expects the first argument to be an object.
// So, using a callback if the method is static.
$return = call_user_func_array(array($class, $info->getName()), $params);
} else {
// Object methods
try {
$object = $info->getDeclaringClass()->newInstance();
} catch (Exception $e) {
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Error instantiating class ' . $class . ' to invoke method ' . $info->getName(), 621);
}
$return = $info->invokeArgs($object, $params);
}
} else {
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Method missing implementation ' . get_class($info));
}

return $return;
}

/**
* Handles each of the 11 different command message types.
*
* A command message is a flex.messaging.messages.CommandMessage
*
* @see Zend_Amf_Value_Messaging_CommandMessage
* @param Zend_Amf_Value_Messaging_CommandMessage $message
* @return Zend_Amf_Value_Messaging_AcknowledgeMessage
*/
protected function _loadCommandMessage(Zend_Amf_Value_Messaging_CommandMessage $message)
{
switch($message->operation) {
case Zend_Amf_Value_Messaging_CommandMessage::CLIENT_PING_OPERATION :
require_once 'Zend/Amf/Value/Messaging/AcknowledgeMessage.php';
$return = new Zend_Amf_Value_Messaging_AcknowledgeMessage($message);
break;
default :
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('CommandMessage::' . $message->operation . ' not implemented');
break;
}
return $return;
}

/**
* Takes the deserialized AMF request and performs any operations.
*
* @todo should implement and SPL observer pattern for custom AMF headers
* @todo implement AMF header authentication
* @param Zend_Amf_Request $request
* @return Zend_Amf_Response
* @throws Zend_Amf_server_Exception|Exception
*/
protected function _handle(Zend_Amf_Request $request)
{
// Get the object encoding of the request.
$objectEncoding = $request->getObjectEncoding();

// create a response object to place the output from the services.
$response = $this->getResponse();

// set reponse encoding
$response->setObjectEncoding($objectEncoding);

$responseBody = $request->getAmfBodies();

// Iterate through each of the service calls in the AMF request
foreach($responseBody as $body)
{
try {
if ($objectEncoding == Zend_Amf_Constants::AMF0_OBJECT_ENCODING) {
// AMF0 Object Encoding
$targetURI = $body->getTargetURI();

// Split the target string into its values.
$source = substr($targetURI, 0, strrpos($targetURI, '.'));

if ($source) {
// Break off method name from namespace into source
$method = substr(strrchr($targetURI, '.'), 1);
$return = $this->_dispatch($method, $body->getData(), $source);
} else {
// Just have a method name.
$return = $this->_dispatch($targetURI, $body->getData());
}
} else {
// AMF3 read message type
$message = $body->getData();
if ($message instanceof Zend_Amf_Value_Messaging_CommandMessage) {
// async call with command message
$return = $this->_loadCommandMessage($message);
} elseif ($message instanceof Zend_Amf_Value_Messaging_RemotingMessage) {
require_once 'Zend/Amf/Value/Messaging/AcknowledgeMessage.php';
$return = new Zend_Amf_Value_Messaging_AcknowledgeMessage($message);
$return->body = $this->_dispatch($message->operation, $message->body, $message->source);
} else {
// Amf3 message sent with netConnection
$targetURI = $body->getTargetURI();

// Split the target string into its values.
$source = substr($targetURI, 0, strrpos($targetURI, '.'));

if ($source) {
// Break off method name from namespace into source
$method = substr(strrchr($targetURI, '.'), 1);
$return = $this->_dispatch($method, array($body->getData()), $source);
} else {
// Just have a method name.
$return = $this->_dispatch($targetURI, $body->getData());
}
}
}
$responseType = Zend_AMF_Constants::RESULT_METHOD;
} catch (Exception $e) {
switch ($objectEncoding) {
case Zend_Amf_Constants::AMF0_OBJECT_ENCODING :
$return = array(
'description' => ($this->isProduction()) ? '' : $e->getMessage(),
'detail' => ($this->isProduction()) ? '' : $e->getTraceAsString(),
'line' => ($this->isProduction()) ? 0 : $e->getLine(),
'code' => $e->getCode(),
);
break;
case Zend_Amf_Constants::AMF3_OBJECT_ENCODING :
require_once 'Zend/Amf/Value/Messaging/ErrorMessage.php';
$return = new Zend_Amf_Value_Messaging_ErrorMessage($message);
$return->faultString = $this->isProduction() ? '' : $e->getMessage();
$return->faultCode = $e->getCode();
$return->faultDetail = $this->isProduction() ? '' : $e->getTraceAsString();
break;
}
$responseType = Zend_AMF_Constants::STATUS_METHOD;
}

$responseURI = $body->getResponseURI() . $responseType;
$newBody = new Zend_Amf_Value_MessageBody($responseURI, null, $return);
$response->addAmfBody($newBody);
}

// serialize the response and return serialized body.
$response->finalize();
}

/**
* Handle an AMF call from the gateway.
*
* @param null|Zend_Amf_Request $request Optional
* @return Zend_Amf_Response
*/
public function handle($request = null)
{
// Check if request was passed otherwise get it from the server
if (is_null($request) || !$request instanceof Zend_Amf_Request) {
$request = $this->getRequest();
} else {
$this->setRequest($request);
}

// Check for errors that may have happend in deserialization of Request.
try {
// Take converted PHP objects and handle service call.
// Serialize to Zend_Amf_response for output stream
$this->_handle($request);
$response = $this->getResponse();
} catch (Exception $e) {
// Handle any errors in the serialization and service calls.
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Handle error: ' . $e->getMessage() . ' ' . $e->getLine());
}

// Return the Amf serialized output string
return $response;
}

/**
* Set request object
*
* @param string|Zend_Amf_Request $request
* @return Zend_Amf_Server
*/
public function setRequest($request)
{
if (is_string($request) && class_exists($request)) {
$request = new $request();
if (!$request instanceof Zend_Amf_Request) {
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Invalid request class');
}
} elseif (!$request instanceof Zend_Amf_Request) {
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Invalid request object');
}
$this->_request = $request;
return $this;
}

/**
* Return currently registered request object
*
* @return null|Zend_Amf_Request
*/
public function getRequest()
{
if (null === $this->_request) {
require_once 'Zend/Amf/Request/Http.php';
$this->setRequest(new Zend_Amf_Request_Http());
}

return $this->_request;
}

/**
* Public access method to private Zend_Amf_Server_Response refrence
*
* @param string|Zend_Amf_Server_Response $response
* @return Zend_Amf_Server
*/
public function setResponse($response)
{
if (is_string($response) && class_exists($response)) {
$response = new $response();
if (!$response instanceof Zend_Amf_Response) {
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Invalid response class');
}
} elseif (!$response instanceof Zend_Amf_Response) {
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Invalid response object');
}
$this->_response = $response;
return $this;
}

/**
* get a refrence to the Zend_Amf_response instance
*
* @return Zend_Amf_Server_Response
*/
public function getResponse()
{
if (null === ($response = $this->_response)) {
require_once 'Zend/Amf/Response/Http.php';
$this->setResponse(new Zend_Amf_Response_Http());
}
return $this->_response;
}

/**
* Add a file system path to a directory of services.
* @param string|array $path
*/
public function setClassPath($path)
{

}

/**
* Attach a class or object to the server
*
* Class may be either a class name or an instantiated object. Reflection
* is done on the class or object to determine the available public
* methods, and each is attached to the server as and available method. If
* a $namespace has been provided, that namespace is used to prefix
* AMF service call.
*
* @param string|object $class
* @param string $namespace Optional
* @param mixed $arg Optional arguments to pass to a method
* @return Zend_Amf_Server
* @throws Zend_Amf_Server_Exception on invalid input
*/
public function setClass($class, $namespace = '', $argv = null)
{
if (is_string($class) && !class_exists($class)){
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Invalid method or class');
} elseif (!is_string($class) && !is_object($class)) {
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Invalid method or class; must be a classname or object');
}

$argv = null;
if (3 < func_num_args()) {
$argv = array_slice(func_get_args(), 2);
}

$this->_methods[] = Zend_Server_Reflection::reflectClass($class, $argv, $namespace);
$this->_buildDispatchTable();

return $this;
}

/**
* Attach a function to the server
*
* Additional arguments to pass to the function at dispatch may be passed;
* any arguments following the namespace will be aggregated and passed at
* dispatch time.
*
* @param string|array $function Valid callback
* @param string $namespace Optional namespace prefix
* @return Zend_Amf_Server
* @throws Zend_Amf_Server_Exception
*/
public function addFunction($function, $namespace = '')
{
if (!is_string($function) && !is_array($function)) {
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Unable to attach function');
}

$argv = null;
if (2 < func_num_args()) {
$argv = array_slice(func_get_args(), 2);
}

$function = (array) $function;
foreach ($function as $func) {
if (!is_string($func) || !function_exists($func)) {
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Unable to attach function');
}
$this->_methods[] = Zend_Server_Reflection::reflectFunction($func, $argv, $namespace);
}

$this->_buildDispatchTable();
return $this;
}


/**
* Creates an array of directories in which services can reside.
*
* @param string $dir
*/
public function addDirectory($dir)
{
$this->_directories[] = $dir;
}

/**
* Returns an array of directories that can hold services.
*
* @return array
*/
public function getDirectory()
{
return $_directory;
}

/**
* (Re)Build the dispatch table
*
* The dispatch table consists of a an array of method name =>
* Zend_Server_Reflection_Function_Abstract pairs
*
* @return void
*/
protected function _buildDispatchTable()
{
$table = array();
foreach ($this->_methods as $key => $dispatchable) {
if ($dispatchable instanceof Zend_Server_Reflection_Function_Abstract) {
$ns = $dispatchable->getNamespace();
$name = $dispatchable->getName();
$name = empty($ns) ? $name : $ns . '.' . $name;

if (isset($table[$name])) {
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Duplicate method registered: ' . $name);
}
$table[$name] = $dispatchable;
continue;
}

if ($dispatchable instanceof Zend_Server_Reflection_Class) {
foreach ($dispatchable->getMethods() as $method) {
$ns = $method->getNamespace();
$name = $method->getName();
$name = empty($ns) ? $name : $ns . '.' . $name;

if (isset($table[$name])) {
require_once 'Zend/Amf/Server/Exception.php';
throw new Zend_Amf_Server_Exception('Duplicate method registered: ' . $name);
}
$table[$name] = $method;
continue;
}
}
}
$this->_table = $table;
}

/**
* Raise a server fault
*
* Unimplemented
*
* @param string|Exception $fault
* @return void
*/
public function fault($fault = null, $code = 404)
{
}

/**
* Returns a list of registered methods
*
* Returns an array of dispatchables (Zend_Server_Reflection_Function,
* _Method, and _Class items).
*
* @return array
*/
public function getFunctions()
{
return $this->_table;
}

/**
* Set server persistence
*
* Unimplemented
*
* @param mixed $mode
* @return void
*/
public function setPersistence($mode)
{
}

/**
* Load server definition
*
* Unimplemented
*
* @param array $definition
* @return void
*/
public function loadFunctions($definition)
{
}

/**
* Map ActionScript classes to PHP classes
*
* @param string $asClass
* @param string $phpClass
* @return Zend_Amf_Server
*/
public function setClassMap($asClass, $phpClass)
{
require_once 'Zend/Amf/Parse/TypeLoader.php';
Zend_Amf_Parse_TypeLoader::setMapping($asClass, $phpClass);
return $this;
}

/**
* List all available methods
*
* Returns an array of method names.
*
* @return array
*/
public function listMethods()
{
return array_keys($this->_table);
}
}

View File

@ -0,0 +1,35 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to version 1.0 of the Zend Framework
* license, that is bundled with this package in the file LICENSE.txt, and
* is available through the world-wide-web at the following URL:
* http://framework.zend.com/license/new-bsd. If you did not receive
* a copy of the Zend Framework license and are unable to obtain it
* through the world-wide-web, please send a note to license@zend.com
* so we can mail you a copy immediately.
*
* @package Zend_Amf
* @subpackage Server
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Amf_Exception */
require_once 'Zend/Amf/Exception.php';

/**
* Zend_Amf_Server_Exception
*
* @category Zend
* @package Zend_Amf
* @subpackage Server
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Server_Exception extends Zend_Amf_Exception
{
}

View File

@ -0,0 +1,278 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Util
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* Utility class to walk through a data stream byte by byte with conventional names
*
* @package Zend_Amf
* @subpackage Util
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Util_BinaryStream
{
/**
* @var string Byte stream
*/
protected $_stream;

/**
* @var int Length of stream
*/
protected $_streamLength;

/**
* @var bool BigEndian encoding?
*/
protected $_bigEndian;

/**
* @var int Current position in stream
*/
protected $_needle;

/**
* Constructor
*
* Create a refrence to a byte stream that is going to be parsed or created
* by the methods in the class. Detect if the class should use big or
* little Endian encoding.
*
* @param string $stream use '' if creating a new stream or pass a string if reading.
* @return void
*/
public function __construct($stream)
{
if (!is_string($stream)) {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception('Inputdata is not of type String');
}

$this->_stream = $stream;
$this->_needle = 0;
$this->_streamLength = strlen($stream);
$testEndian = unpack("C*", pack("S*", 256));
$this->_bigEndian = 1;
}

/**
* Returns the current stream
*
* @return string
*/
public function getStream()
{
return $this->_stream;
}

/**
* Read the number of bytes in a row for the length supplied.
*
* @todo Should check that there are enough bytes left in the stream we are about to read.
* @param int $length
* @return string
* @throws Zend_Amf_Exception for buffer underrun
*/
public function readBytes($length)
{
if (($length + $this->_needle) > strlen($this->_stream)) {
require_once 'Zend/Amf/Exception.php';
throw new Zend_Amf_Exception("Buffer underrun at needle position: " . $this->_needle . " while requesting length: " . $length);
}
$bytes = substr($this->_stream, $this->_needle, $length);
$this->_needle += $length;
return $bytes;
}

/**
* Write any length of bytes to the stream
*
* Usually a string.
*
* @param string $bytes
* @return Zend_Amf_Util_BinaryStream
*/
public function writeBytes($bytes)
{
$this->_stream .= $bytes;
return $this;
}

/**
* Reads a signed byte
*
* @return int Value is in the range of -128 to 127.
*/
public function readByte()
{
$byte = ord($this->_stream[$this->_needle++]);
return $byte;
}

/**
* Writes the passed string into a signed byte on the stream.
*
* @param string $stream
* @return Zend_Amf_Util_BinaryStream
*/
public function writeByte($stream)
{
$this->_stream .= pack("c",$stream);
return $this;
}

/**
* Reads a signed 32-bit integer from the data stream.
*
* @return int Value is in the range of -2147483648 to 2147483647
*/
public function readInt()
{
$int = ($this->readByte() << 8) + $this->readByte();
return $int;
}

/**
* Write an the integer to the output stream as a 32 bit signed integer
*
* @param int $stream
* @return Zend_Amf_Util_BinaryStream
*/
public function writeInt($stream)
{
$this->_stream .= pack("n", $stream);
return $this;
}

/**
* Reads a UTF-8 string from the data stream
*
* @return string A UTF-8 string produced by the byte representation of characters
*/
public function readUtf()
{
$length = $this->readInt();
return $this->readBytes($length);
}

/**
* Wite a UTF-8 string to the outputstream
*
* @param string $stream
* @return Zend_Amf_Util_BinaryStream
*/
public function writeUtf($stream)
{
$this->writeInt(strlen($stream));
$this->_stream .= $stream;
return $this;
}


/**
* Read a long UTF string
*
* @return string
*/
public function readLongUtf()
{
$length = $this->readLong();
return $this->readBytes($length);
}

/**
* Write a long UTF string to the buffer
*
* @param string $stream
* @return Zend_Amf_Util_BinaryStream
*/
public function writeLongUtf($stream)
{
$this->writeLong(strlen($stream));
$this->_stream .= $stream;
}

/**
* Read a long numeric value
*
* @return double
*/
public function readLong()
{
$long = ($this->readByte() << 24) + ($this->readByte() << 16) + ($this->readByte() << 8) + $this->readByte();
return $long;
}

/**
* Write long numeric value to output stream
*
* @param int|string $stream
* @return Zend_Amf_Util_BinaryStream
*/
public function writeLong($stream)
{
$this->_stream .= pack("N",$stream);
return $this;
}

/**
* Read a 16 bit unsigned short.
*
* @todo This could use the unpack() w/ S,n, or v
* @return double
*/
public function readUnsignedShort()
{
$byte1 = $this->readByte();
$byte2 = $this->readByte();
$short = (($byte1 << 8) | $byte2);
return $short;
}

/**
* Reads an IEEE 754 double-precision floating point number from the data stream.
*
* @return double Floating point number
*/
public function readDouble()
{
$bytes = substr($this->_stream, $this->_needle, 8);
$this->_needle += 8;
$double = unpack("dflt", strrev($bytes));
return $double['flt'];
}

/**
* Writes an IEEE 754 double-precision floating point number from the data stream.
*
* @param string|double $stream
* @return Zend_Amf_Util_BinaryStream
*/
public function writeDouble($stream)
{
$stream = pack("d", $stream);
if ($this->_bigEndian) {
$stream = strrev($stream);
}
$this->_stream .= $stream;
return $this;
}
}

View File

@ -0,0 +1,57 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* Wrapper class to store an AMF3 flash.utils.ByteArray
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_ByteArray
{
/**
* @var string ByteString Data
*/
protected $_data = '';

/**
* Create a ByteArray
*
* @param string $data
* @return void
*/
public function __construct($data)
{
$this->_data = $data;
}

/**
* Return the byte stream
*
* @return string
*/
public function getData()
{
return $this->_data;
}
}

View File

@ -0,0 +1,181 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* An AMF Message contains information about the actual individual
* transaction that is to be performed. It specifies the remote
* operation that is to be performed; a local (client) operation
* to be invoked upon success; and, the data to be used in the
* operation.
* <p/>
* This Message structure defines how a local client would
* invoke a method/operation on a remote server. Additionally,
* the response from the Server is structured identically.
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_MessageBody
{
/**
* A string describing which operation, function, or method
* is to be remotley invoked.
* @var string
*/
protected $_targetUri = "";

/**
* Universal Resource Identifier that uniquely targets the originator's
* Object that should receive the server's response. The server will
* use this path specification to target the "OnResult()" or "onStatus()"
* handlers within the client. For Flash, it specifies an ActionScript
* Object path only. The NetResponse object pointed to by the Response Uri
* contains the connection state information. Passing/specifying this
* provides a convenient mechanism for the client/server to share access
* to an object that is managing the state of the shared connection.
*
* Since the server will use this field in the event of an error,
* this field is required even if a successful server request would
* not be expected to return a value to the client.
*
* @var string
*/
protected $_responseUri = "";

/**
* Contains the actual data associated with the operation. It contains
* the client's parameter data that is passed to the server's operation/method.
* When serializing a root level data type or a parameter list array, no
* name field is included. That is, the data is anonomously represented
* as "Type Marker"/"Value" pairs. When serializing member data, the data is
* represented as a series of "Name"/"Type"/"Value" combinations.
*
* For server generated responses, it may contain any ActionScript
* data/objects that the server was expected to provide.
*
* @var string
*/
protected $_data;

/**
* Constructor
*
* @param string $targetUri
* @param string $responseUri
* @param string $data
* @return void
*/
public function __construct($targetUri, $responseUri, $data)
{
$this->setTargetUri($targetUri);
$this->setResponseUri($responseUri);
$this->setData($data);
}

/**
* Retrieve target Uri
*
* @return string
*/
public function getTargetUri()
{
return $this->_targetUri;
}

/**
* Set target Uri
*
* @param string $targetUri
* @return Zend_Amf_Value_MessageBody
*/
public function setTargetUri($targetUri)
{
if (null === $targetUri) {
$targetUri = '';
}
$this->_targetUri = (string) $targetUri;
return $this;
}

/**
* Get target Uri
*
* @return string
*/
public function getResponseUri()
{
return $this->_responseUri;
}

/**
* Set response Uri
*
* @param string $responseUri
* @return Zend_Amf_Value_MessageBody
*/
public function setResponseUri($responseUri)
{
if (null === $responseUri) {
$responseUri = '';
}
$this->_responseUri = $responseUri;
return $this;
}

/**
* Retrieve response data
*
* @return string
*/
public function getData()
{
return $this->_data;
}

/**
* Set response data
*
* @param mixed $data
* @return Zend_Amf_Value_MessageBody
*/
public function setData($data)
{
$this->_data = $data;
return $this;
}

/**
* Set reply method
*
* @param string $methodName
* @return Zend_Amf_Value_MessageBody
*/
public function setReplyMethod($methodName)
{
if (!preg_match('#^[/?]#', $methodName)) {
$this->_targetUri = rtrim($this->_targetUri, '/') . '/';
}
$this->_targetUri = $this->_targetUri . $methodName;
return $this;
}
}

View File

@ -0,0 +1,80 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* Message Headers provide context for the processing of the
* the AMF Packet and all subsequent Messages.
*
* Multiple Message Headers may be included within an AMF Packet.
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_MessageHeader
{
/**
* Name of the header
*
* @var string
*/
public $name;

/**
* Flag if the data has to be parsed on return
*
* @var boolean
*/
public $mustRead;

/**
* Length of the data field
*
* @var int
*/
public $length;

/**
* Data sent with the header name
*
* @var mixed
*/
public $data;

/**
* Used to create and store AMF Header data.
*
* @param String $name
* @param Boolean $mustRead
* @param misc $content
* @param integer $length
*/
public function __construct($name, $mustRead, $data, $length=null)
{
$this->name = $name;
$this->mustRead = (bool) $mustRead;
$this->data = $data;
if (null !== $length) {
$this->length = (int) $length;
}
}
}

View File

@ -0,0 +1,91 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* This is the default Implementation of Message, which provides
* a convenient base for behavior and association of common endpoints
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_Messaging_AbstractMessage
{
/**
* @var string Client identifier
*/
public $clientId;

/**
* @var string Destination
*/
public $destination;

/**
* @var string Message identifier
*/
public $messageId;

/**
* @var int Message timestamp
*/
public $timestamp;

/**
* @var int Message TTL
*/
public $timeToLive;

/**
* @var object Message headers
*/
public $headers;

/**
* @var string Message body
*/
public $body;

/**
* generate a unique id
*
* Format is: ########-####-####-####-############
* Where # is an uppercase letter or number
* example: 6D9DC7EC-A273-83A9-ABE3-00005FD752D6
*
* @return string
*/
public function generateId()
{
return sprintf(
'%08X-%04X-%04X-%02X%02X-%012X',
mt_rand(),
mt_rand(0, 65535),
bindec(substr_replace(
sprintf('%016b', mt_rand(0, 65535)), '0100', 11, 4)
),
bindec(substr_replace(sprintf('%08b', mt_rand(0, 255)), '01', 5, 2)),
mt_rand(0, 255),
mt_rand()
);
}
}

View File

@ -0,0 +1,59 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Amf_Value_Messaging_AsyncMessage */
require_once 'Zend/Amf/Value/Messaging/AsyncMessage.php';

/**
* This is the type of message returned by the MessageBroker
* to endpoints after the broker has routed an endpoint's message
* to a service.
*
* flex.messaging.messages.AcknowledgeMessage
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_Messaging_AcknowledgeMessage extends Zend_Amf_Value_Messaging_AsyncMessage
{
/**
* Create a new Acknowledge Message
*
* @param unknown_type $message
*/
public function __construct($message)
{
$this->clientId = $this->generateId();
$this->destination = null;
$this->messageId = $this->generateId();
$this->timestamp = time().'00';
$this->timeToLive = 0;
$this->headers = new STDClass();
$this->body = null;

// correleate the two messages
if ($message) {
$this->correlationId = $message->messageId;
}
}
}

View File

@ -0,0 +1,42 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/


/** Zend_Amf_Value_Messaging_AbstractMessage */
require_once 'Zend/Amf/Value/Messaging/AbstractMessage.php';

/**
* This type of message contains information necessary to perform
* point-to-point or publish-subscribe messaging.
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_Messaging_AsyncMessage extends Zend_Amf_Value_Messaging_AbstractMessage
{
/**
* The message id to be responded to.
* @var String
*/
public $correlationId;
}

View File

@ -0,0 +1,127 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

require_once 'Zend/Amf/Value/Messaging/AsyncMessage.php';

/**
* A message that represents an infrastructure command passed between
* client and server. Subscribe/unsubscribe operations result in
* CommandMessage transmissions, as do polling operations.
*
* Corresponds to flex.messaging.messages.CommandMessage
*
* Note: THESE VALUES MUST BE THE SAME ON CLIENT AND SERVER
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_Messaging_CommandMessage extends Zend_Amf_Value_Messaging_AsyncMessage
{
/**
* This operation is used to subscribe to a remote destination.
* @const int
*/
const SUBSCRIBE_OPERATION = 0;

/**
* This operation is used to unsubscribe from a remote destination.
* @const int
*/
const UNSUSBSCRIBE_OPERATION = 1;

/**
* This operation is used to poll a remote destination for pending,
* undelivered messages.
* @const int
*/
const POLL_OPERATION = 2;

/**
* This operation is used by a remote destination to sync missed or cached messages
* back to a client as a result of a client issued poll command.
* @const int
*/
const CLIENT_SYNC_OPERATION = 4;

/**
* This operation is used to test connectivity over the current channel to
* the remote endpoint.
* @const int
*/
const CLIENT_PING_OPERATION = 5;

/**
* This operation is used to request a list of failover endpoint URIs
* for the remote destination based on cluster membership.
* @const int
*/
const CLUSTER_REQUEST_OPERATION = 7;

/**
* This operation is used to send credentials to the endpoint so that
* the user can be logged in over the current channel.
* The credentials need to be Base64 encoded and stored in the <code>body</code>
* of the message.
* @const int
*/
const LOGIN_OPERATION = 8;

/**
* This operation is used to log the user out of the current channel, and
* will invalidate the server session if the channel is HTTP based.
* @const int
*/
const LOGOUT_OPERATION = 9;

/**
* This operation is used to indicate that the client's subscription to a
* remote destination has been invalidated.
* @const int
*/
const SESSION_INVALIDATE_OPERATION = 10;

/**
* This operation is used by the MultiTopicConsumer to subscribe/unsubscribe
* from multiple subtopics/selectors in the same message.
* @const int
*/
const MULTI_SUBSCRIBE_OPERATION = 11;

/**
* This operation is used to indicate that a channel has disconnected
* @const int
*/
const DISCONNECT_OPERATION = 12;

/**
* This is the default operation for new CommandMessage instances.
* @const int
*/
const UNKNOWN_OPERATION = 10000;

/**
* The operation to execute for messages of this type
* @var int
*/
public $operation = self::UNKNOWN_OPERATION;
}

View File

@ -0,0 +1,66 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Amf_Value_Messaging_AcknowledgeMessage */
require_once 'Zend/Amf/Value/Messaging/AcknowledgeMessage.php';

/**
* Creates the error message to report to flex the issue with the call
*
* Corresponds to flex.messaging.messages.ErrorMessage
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_Messaging_ErrorMessage extends Zend_Amf_Value_Messaging_AcknowledgeMessage
{
/**
* Additional data with error
* @var object
*/
public $extendedData = null;

/**
* Error code number
* @var string
*/
public $faultCode;

/**
* Description as to the cause of the error
* @var string
*/
public $faultDetail;

/**
* Short description of error
* @var string
*/
public $faultString = '';

/**
* root cause of error
* @var object
*/
public $rootCause = null;
}

View File

@ -0,0 +1,72 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/** Zend_Amf_Value_Messaging_AbstractMessage */
require_once 'Zend/Amf/Value/Messaging/AbstractMessage.php';

/**
* This type of message contains information needed to perform
* a Remoting invocation.
*
* Corresponds to flex.messaging.messages.RemotingMessage
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_Messaging_RemotingMessage extends Zend_Amf_Value_Messaging_AbstractMessage
{

/**
* The name of the service to be called including package name
* @var String
*/
public $source;

/**
* The name of the method to be called
* @var string
*/
public $operation;

/**
* The arguments to call the mathod with
* @var array
*/
public $parameters;

/**
* Create a new Remoting Message
*
* @return void
*/
public function __construct()
{
$this->clientId = $this->generateId();
$this->destination = null;
$this->messageId = $this->generateId();
$this->timestamp = time().'00';
$this->timeToLive = 0;
$this->headers = new stdClass();
$this->body = null;
}
}

View File

@ -0,0 +1,153 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* Zend_Amf_Value_TraitsInfo
*
* @package Zend_Amf
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Amf_Value_TraitsInfo
{
/**
* @var string Class name
*/
protected $_className;

/**
* @var bool Whether or not this is a dynamic class
*/
protected $_dynamic;

/**
* @var bool Whether or not the class is externalizable
*/
protected $_externalizable;

/**
* @var array Class properties
*/
protected $_properties;

/**
* Used to keep track of all class traits of an AMF3 object
*
* @param string $className
* @param boolean $dynamic
* @param boolean $externalizable
* @param boolean $properties
* @return void
*/
public function __construct($className, $dynamic=false, $externalizable=false, $properties=null)
{
$this->_className = $className;
$this->_dynamic = $dynamic;
$this->_externalizable = $externalizable;
$this->_properties = $properties;
}

/**
* Test if the class is a dynamic class
*
* @return boolean
*/
public function isDynamic()
{
return $this->_dynamic;
}

/**
* Test if class is externalizable
*
* @return boolean
*/
public function isExternalizable()
{
return $this->_externalizable;
}

/**
* Return the number of properties in the class
*
* @return int
*/
public function length()
{
return count($this->_properties);
}

/**
* Return the class name
*
* @return string
*/
public function getClassName()
{
return $this->_className;
}

/**
* Add an additional property
*
* @param string $name
* @return Zend_Amf_Value_TraitsInfo
*/
public function addProperty($name)
{
$this->_properties[] = $name;
return $this;
}

/**
* Add all properties of the class.
*
* @param array $props
* @return Zend_Amf_Value_TraitsInfo
*/
public function addAllProperties(array $props)
{
$this->_properties = $props;
return $this;
}

/**
* Get the property at a given index
*
* @param int $index
* @return string
*/
public function getProperty($index)
{
return $this->_properties[(int) $index];
}

/**
* Return all properties of the class.
*
* @return array
*/
public function getAllProperties()
{
return $this->_properties;
}
}

161
libs/Zend/Auth.php Normal file
View File

@ -0,0 +1,161 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Auth
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Auth.php 11747 2008-10-08 18:33:58Z norm2782 $
*/


/**
* @category Zend
* @package Zend_Auth
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Auth
{
/**
* Singleton instance
*
* @var Zend_Auth
*/
protected static $_instance = null;

/**
* Persistent storage handler
*
* @var Zend_Auth_Storage_Interface
*/
protected $_storage = null;

/**
* Singleton pattern implementation makes "new" unavailable
*
* @return void
*/
protected function __construct()
{}

/**
* Singleton pattern implementation makes "clone" unavailable
*
* @return void
*/
protected function __clone()
{}

/**
* Returns an instance of Zend_Auth
*
* Singleton pattern implementation
*
* @return Zend_Auth Provides a fluent interface
*/
public static function getInstance()
{
if (null === self::$_instance) {
self::$_instance = new self();
}

return self::$_instance;
}

/**
* Returns the persistent storage handler
*
* Session storage is used by default unless a different storage adapter has been set.
*
* @return Zend_Auth_Storage_Interface
*/
public function getStorage()
{
if (null === $this->_storage) {
/**
* @see Zend_Auth_Storage_Session
*/
require_once 'Zend/Auth/Storage/Session.php';
$this->setStorage(new Zend_Auth_Storage_Session());
}

return $this->_storage;
}

/**
* Sets the persistent storage handler
*
* @param Zend_Auth_Storage_Interface $storage
* @return Zend_Auth Provides a fluent interface
*/
public function setStorage(Zend_Auth_Storage_Interface $storage)
{
$this->_storage = $storage;
return $this;
}

/**
* Authenticates against the supplied adapter
*
* @param Zend_Auth_Adapter_Interface $adapter
* @return Zend_Auth_Result
*/
public function authenticate(Zend_Auth_Adapter_Interface $adapter)
{
$result = $adapter->authenticate();

if ($result->isValid()) {
$this->getStorage()->write($result->getIdentity());
}

return $result;
}

/**
* Returns true if and only if an identity is available from storage
*
* @return boolean
*/
public function hasIdentity()
{
return !$this->getStorage()->isEmpty();
}

/**
* Returns the identity from storage or null if no identity is available
*
* @return mixed|null
*/
public function getIdentity()
{
$storage = $this->getStorage();

if ($storage->isEmpty()) {
return null;
}

return $storage->read();
}

/**
* Clears the identity from persistent storage
*
* @return void
*/
public function clearIdentity()
{
$this->getStorage()->clear();
}
}

View File

@ -0,0 +1,461 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: DbTable.php 8862 2008-03-16 15:36:00Z thomas $
*/


/**
* @see Zend_Auth_Adapter_Interface
*/
require_once 'Zend/Auth/Adapter/Interface.php';

/**
* @see Zend_Db_Adapter_Abstract
*/
require_once 'Zend/Db/Adapter/Abstract.php';

/**
* @see Zend_Auth_Result
*/
require_once 'Zend/Auth/Result.php';


/**
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface
{
/**
* Database Connection
*
* @var Zend_Db_Adapter_Abstract
*/
protected $_zendDb = null;

/**
* $_tableName - the table name to check
*
* @var string
*/
protected $_tableName = null;

/**
* $_identityColumn - the column to use as the identity
*
* @var string
*/
protected $_identityColumn = null;

/**
* $_credentialColumns - columns to be used as the credentials
*
* @var string
*/
protected $_credentialColumn = null;

/**
* $_identity - Identity value
*
* @var string
*/
protected $_identity = null;

/**
* $_credential - Credential values
*
* @var string
*/
protected $_credential = null;

/**
* $_credentialTreatment - Treatment applied to the credential, such as MD5() or PASSWORD()
*
* @var string
*/
protected $_credentialTreatment = null;

/**
* $_authenticateResultInfo
*
* @var array
*/
protected $_authenticateResultInfo = null;
/**
* $_resultRow - Results of database authentication query
*
* @var array
*/
protected $_resultRow = null;

/**
* __construct() - Sets configuration options
*
* @param Zend_Db_Adapter_Abstract $zendDb
* @param string $tableName
* @param string $identityColumn
* @param string $credentialColumn
* @param string $credentialTreatment
* @return void
*/
public function __construct(Zend_Db_Adapter_Abstract $zendDb, $tableName = null, $identityColumn = null,
$credentialColumn = null, $credentialTreatment = null)
{
$this->_zendDb = $zendDb;

if (null !== $tableName) {
$this->setTableName($tableName);
}

if (null !== $identityColumn) {
$this->setIdentityColumn($identityColumn);
}

if (null !== $credentialColumn) {
$this->setCredentialColumn($credentialColumn);
}

if (null !== $credentialTreatment) {
$this->setCredentialTreatment($credentialTreatment);
}
}

/**
* setTableName() - set the table name to be used in the select query
*
* @param string $tableName
* @return Zend_Auth_Adapter_DbTable Provides a fluent interface
*/
public function setTableName($tableName)
{
$this->_tableName = $tableName;
return $this;
}

/**
* setIdentityColumn() - set the column name to be used as the identity column
*
* @param string $identityColumn
* @return Zend_Auth_Adapter_DbTable Provides a fluent interface
*/
public function setIdentityColumn($identityColumn)
{
$this->_identityColumn = $identityColumn;
return $this;
}

/**
* setCredentialColumn() - set the column name to be used as the credential column
*
* @param string $credentialColumn
* @return Zend_Auth_Adapter_DbTable Provides a fluent interface
*/
public function setCredentialColumn($credentialColumn)
{
$this->_credentialColumn = $credentialColumn;
return $this;
}

/**
* setCredentialTreatment() - allows the developer to pass a parameterized string that is
* used to transform or treat the input credential data
*
* In many cases, passwords and other sensitive data are encrypted, hashed, encoded,
* obscured, or otherwise treated through some function or algorithm. By specifying a
* parameterized treatment string with this method, a developer may apply arbitrary SQL
* upon input credential data.
*
* Examples:
*
* 'PASSWORD(?)'
* 'MD5(?)'
*
* @param string $treatment
* @return Zend_Auth_Adapter_DbTable Provides a fluent interface
*/
public function setCredentialTreatment($treatment)
{
$this->_credentialTreatment = $treatment;
return $this;
}

/**
* setIdentity() - set the value to be used as the identity
*
* @param string $value
* @return Zend_Auth_Adapter_DbTable Provides a fluent interface
*/
public function setIdentity($value)
{
$this->_identity = $value;
return $this;
}

/**
* setCredential() - set the credential value to be used, optionally can specify a treatment
* to be used, should be supplied in parameterized form, such as 'MD5(?)' or 'PASSWORD(?)'
*
* @param string $credential
* @return Zend_Auth_Adapter_DbTable Provides a fluent interface
*/
public function setCredential($credential)
{
$this->_credential = $credential;
return $this;
}

/**
* getResultRowObject() - Returns the result row as a stdClass object
*
* @param string|array $returnColumns
* @param string|array $omitColumns
* @return stdClass|boolean
*/
public function getResultRowObject($returnColumns = null, $omitColumns = null)
{
if (!$this->_resultRow) {
return false;
}
$returnObject = new stdClass();

if (null !== $returnColumns) {

$availableColumns = array_keys($this->_resultRow);
foreach ( (array) $returnColumns as $returnColumn) {
if (in_array($returnColumn, $availableColumns)) {
$returnObject->{$returnColumn} = $this->_resultRow[$returnColumn];
}
}
return $returnObject;

} elseif (null !== $omitColumns) {

$omitColumns = (array) $omitColumns;
foreach ($this->_resultRow as $resultColumn => $resultValue) {
if (!in_array($resultColumn, $omitColumns)) {
$returnObject->{$resultColumn} = $resultValue;
}
}
return $returnObject;

} else {

foreach ($this->_resultRow as $resultColumn => $resultValue) {
$returnObject->{$resultColumn} = $resultValue;
}
return $returnObject;

}
}

/**
* authenticate() - defined by Zend_Auth_Adapter_Interface. This method is called to
* attempt an authenication. Previous to this call, this adapter would have already
* been configured with all nessissary information to successfully connect to a database
* table and attempt to find a record matching the provided identity.
*
* @throws Zend_Auth_Adapter_Exception if answering the authentication query is impossible
* @return Zend_Auth_Result
*/
public function authenticate()
{
$this->_authenticateSetup();
$dbSelect = $this->_authenticateCreateSelect();
$resultIdentities = $this->_authenticateQuerySelect($dbSelect);
if ( ($authResult = $this->_authenticateValidateResultset($resultIdentities)) instanceof Zend_Auth_Result) {
return $authResult;
}
$authResult = $this->_authenticateValidateResult(array_shift($resultIdentities));
return $authResult;
}

/**
* _authenticateSetup() - This method abstracts the steps involved with making sure
* that this adapter was indeed setup properly with all required peices of information.
*
* @throws Zend_Auth_Adapter_Exception - in the event that setup was not done properly
* @return true
*/
protected function _authenticateSetup()
{
$exception = null;

if ($this->_tableName == '') {
$exception = 'A table must be supplied for the Zend_Auth_Adapter_DbTable authentication adapter.';
} elseif ($this->_identityColumn == '') {
$exception = 'An identity column must be supplied for the Zend_Auth_Adapter_DbTable authentication adapter.';
} elseif ($this->_credentialColumn == '') {
$exception = 'A credential column must be supplied for the Zend_Auth_Adapter_DbTable authentication adapter.';
} elseif ($this->_identity == '') {
$exception = 'A value for the identity was not provided prior to authentication with Zend_Auth_Adapter_DbTable.';
} elseif ($this->_credential === null) {
$exception = 'A credential value was not provided prior to authentication with Zend_Auth_Adapter_DbTable.';
}

if (null !== $exception) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception($exception);
}
$this->_authenticateResultInfo = array(
'code' => Zend_Auth_Result::FAILURE,
'identity' => $this->_identity,
'messages' => array()
);
return true;
}

/**
* _authenticateCreateSelect() - This method creates a Zend_Db_Select object that
* is completely configured to be queried against the database.
*
* @return Zend_Db_Select
*/
protected function _authenticateCreateSelect()
{
// build credential expression
if (empty($this->_credentialTreatment) || (strpos($this->_credentialTreatment, "?") === false)) {
$this->_credentialTreatment = '?';
}

$credentialExpression = new Zend_Db_Expr(
'(CASE WHEN ' .
$this->_zendDb->quoteInto(
$this->_zendDb->quoteIdentifier($this->_credentialColumn, true)
. ' = ' . $this->_credentialTreatment, $this->_credential
)
. ' THEN 1 ELSE 0 END) AS '
. $this->_zendDb->quoteIdentifier('zend_auth_credential_match')
);

// get select
$dbSelect = $this->_zendDb->select();
$dbSelect->from($this->_tableName, array('*', $credentialExpression))
->where($this->_zendDb->quoteIdentifier($this->_identityColumn, true) . ' = ?', $this->_identity);

return $dbSelect;
}

/**
* _authenticateQuerySelect() - This method accepts a Zend_Db_Select object and
* performs a query against the database with that object.
*
* @param Zend_Db_Select $dbSelect
* @throws Zend_Auth_Adapter_Exception - when a invalid select object is encoutered
* @return array
*/
protected function _authenticateQuerySelect(Zend_Db_Select $dbSelect)
{
try {
if ($this->_zendDb->getFetchMode() != Zend_DB::FETCH_ASSOC) {
$origDbFetchMode = $this->_zendDb->getFetchMode();
$this->_zendDb->setFetchMode(Zend_DB::FETCH_ASSOC);
}
$resultIdentities = $this->_zendDb->fetchAll($dbSelect->__toString());
if (isset($origDbFetchMode)) {
$this->_zendDb->setFetchMode($origDbFetchMode);
unset($origDbFetchMode);
}
} catch (Exception $e) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('The supplied parameters to Zend_Auth_Adapter_DbTable failed to '
. 'produce a valid sql statement, please check table and column names '
. 'for validity.');
}
return $resultIdentities;
}

/**
* _authenticateValidateResultSet() - This method attempts to make certian that only one
* record was returned in the result set
*
* @param array $resultIdentities
* @return true|Zend_Auth_Result
*/
protected function _authenticateValidateResultSet(array $resultIdentities)
{


if (count($resultIdentities) < 1) {
$this->_authenticateResultInfo['code'] = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND;
$this->_authenticateResultInfo['messages'][] = 'A record with the supplied identity could not be found.';
return $this->_authenticateCreateAuthResult();
} elseif (count($resultIdentities) > 1) {
$this->_authenticateResultInfo['code'] = Zend_Auth_Result::FAILURE_IDENTITY_AMBIGUOUS;
$this->_authenticateResultInfo['messages'][] = 'More than one record matches the supplied identity.';
return $this->_authenticateCreateAuthResult();
}

return true;
}

/**
* _authenticateValidateResult() - This method attempts to validate that the record in the
* result set is indeed a record that matched the identity provided to this adapter.
*
* @param array $resultIdentity
* @return Zend_Auth_Result
*/
protected function _authenticateValidateResult($resultIdentity)
{
if ($resultIdentity['zend_auth_credential_match'] != '1') {
$this->_authenticateResultInfo['code'] = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;
$this->_authenticateResultInfo['messages'][] = 'Supplied credential is invalid.';
return $this->_authenticateCreateAuthResult();
}

unset($resultIdentity['zend_auth_credential_match']);
$this->_resultRow = $resultIdentity;

$this->_authenticateResultInfo['code'] = Zend_Auth_Result::SUCCESS;
$this->_authenticateResultInfo['messages'][] = 'Authentication successful.';
return $this->_authenticateCreateAuthResult();
}
/**
* _authenticateCreateAuthResult() - This method creates a Zend_Auth_Result object
* from the information that has been collected during the authenticate() attempt.
*
* @return Zend_Auth_Result
*/
protected function _authenticateCreateAuthResult()
{
return new Zend_Auth_Result(
$this->_authenticateResultInfo['code'],
$this->_authenticateResultInfo['identity'],
$this->_authenticateResultInfo['messages']
);
}

}

View File

@ -0,0 +1,230 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Digest.php 9668 2008-06-11 08:15:02Z doctorrock83 $
*/


/**
* @see Zend_Auth_Adapter_Interface
*/
require_once 'Zend/Auth/Adapter/Interface.php';


/**
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Auth_Adapter_Digest implements Zend_Auth_Adapter_Interface
{
/**
* Filename against which authentication queries are performed
*
* @var string
*/
protected $_filename;

/**
* Digest authentication realm
*
* @var string
*/
protected $_realm;

/**
* Digest authentication user
*
* @var string
*/
protected $_username;

/**
* Password for the user of the realm
*
* @var string
*/
protected $_password;

/**
* Sets adapter options
*
* @param mixed $filename
* @param mixed $realm
* @param mixed $username
* @param mixed $password
* @return void
*/
public function __construct($filename = null, $realm = null, $username = null, $password = null)
{
$options = array('filename', 'realm', 'username', 'password');
foreach ($options as $option) {
if (null !== $$option) {
$methodName = 'set' . ucfirst($option);
$this->$methodName($$option);
}
}
}

/**
* Returns the filename option value or null if it has not yet been set
*
* @return string|null
*/
public function getFilename()
{
return $this->_filename;
}

/**
* Sets the filename option value
*
* @param mixed $filename
* @return Zend_Auth_Adapter_Digest Provides a fluent interface
*/
public function setFilename($filename)
{
$this->_filename = (string) $filename;
return $this;
}

/**
* Returns the realm option value or null if it has not yet been set
*
* @return string|null
*/
public function getRealm()
{
return $this->_realm;
}

/**
* Sets the realm option value
*
* @param mixed $realm
* @return Zend_Auth_Adapter_Digest Provides a fluent interface
*/
public function setRealm($realm)
{
$this->_realm = (string) $realm;
return $this;
}

/**
* Returns the username option value or null if it has not yet been set
*
* @return string|null
*/
public function getUsername()
{
return $this->_username;
}

/**
* Sets the username option value
*
* @param mixed $username
* @return Zend_Auth_Adapter_Digest Provides a fluent interface
*/
public function setUsername($username)
{
$this->_username = (string) $username;
return $this;
}

/**
* Returns the password option value or null if it has not yet been set
*
* @return string|null
*/
public function getPassword()
{
return $this->_password;
}

/**
* Sets the password option value
*
* @param mixed $password
* @return Zend_Auth_Adapter_Digest Provides a fluent interface
*/
public function setPassword($password)
{
$this->_password = (string) $password;
return $this;
}

/**
* Defined by Zend_Auth_Adapter_Interface
*
* @throws Zend_Auth_Adapter_Exception
* @return Zend_Auth_Result
*/
public function authenticate()
{
$optionsRequired = array('filename', 'realm', 'username', 'password');
foreach ($optionsRequired as $optionRequired) {
if (null === $this->{"_$optionRequired"}) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception("Option '$optionRequired' must be set before authentication");
}
}

if (false === ($fileHandle = @fopen($this->_filename, 'r'))) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception("Cannot open '$this->_filename' for reading");
}

$id = "$this->_username:$this->_realm";
$idLength = strlen($id);

$result = array(
'code' => Zend_Auth_Result::FAILURE,
'identity' => array(
'realm' => $this->_realm,
'username' => $this->_username,
),
'messages' => array()
);

while ($line = trim(fgets($fileHandle))) {
if (substr($line, 0, $idLength) === $id) {
if (substr($line, -32) === md5("$this->_username:$this->_realm:$this->_password")) {
$result['code'] = Zend_Auth_Result::SUCCESS;
} else {
$result['code'] = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;
$result['messages'][] = 'Password incorrect';
}
return new Zend_Auth_Result($result['code'], $result['identity'], $result['messages']);
}
}

$result['code'] = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND;
$result['messages'][] = "Username '$this->_username' and realm '$this->_realm' combination not found";
return new Zend_Auth_Result($result['code'], $result['identity'], $result['messages']);
}
}

View File

@ -0,0 +1,38 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 8862 2008-03-16 15:36:00Z thomas $
*/


/**
* Zend_Auth_Exception
*/
require_once 'Zend/Auth/Exception.php';


/**
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Auth_Adapter_Exception extends Zend_Auth_Exception
{}

View File

@ -0,0 +1,847 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter_Http
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Http.php 12503 2008-11-10 16:28:40Z matthew $
*/


/**
* @see Zend_Auth_Adapter_Interface
*/
require_once 'Zend/Auth/Adapter/Interface.php';


/**
* HTTP Authentication Adapter
*
* Implements a pretty good chunk of RFC 2617.
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter_Http
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @todo Support auth-int
* @todo Track nonces, nonce-count, opaque for replay protection and stale support
* @todo Support Authentication-Info header
*/
class Zend_Auth_Adapter_Http implements Zend_Auth_Adapter_Interface
{
/**
* Reference to the HTTP Request object
*
* @var Zend_Controller_Request_Http
*/
protected $_request;

/**
* Reference to the HTTP Response object
*
* @var Zend_Controller_Response_Http
*/
protected $_response;

/**
* Object that looks up user credentials for the Basic scheme
*
* @var Zend_Auth_Adapter_Http_Resolver_Interface
*/
protected $_basicResolver;

/**
* Object that looks up user credentials for the Digest scheme
*
* @var Zend_Auth_Adapter_Http_Resolver_Interface
*/
protected $_digestResolver;

/**
* List of authentication schemes supported by this class
*
* @var array
*/
protected $_supportedSchemes = array('basic', 'digest');

/**
* List of schemes this class will accept from the client
*
* @var array
*/
protected $_acceptSchemes;

/**
* Space-delimited list of protected domains for Digest Auth
*
* @var string
*/
protected $_domains;

/**
* The protection realm to use
*
* @var string
*/
protected $_realm;

/**
* Nonce timeout period
*
* @var integer
*/
protected $_nonceTimeout;

/**
* Whether to send the opaque value in the header. True by default
*
* @var boolean
*/
protected $_useOpaque;

/**
* List of the supported digest algorithms. I want to support both MD5 and
* MD5-sess, but MD5-sess won't make it into the first version.
*
* @var array
*/
protected $_supportedAlgos = array('MD5');

/**
* The actual algorithm to use. Defaults to MD5
*
* @var string
*/
protected $_algo;

/**
* List of supported qop options. My intetion is to support both 'auth' and
* 'auth-int', but 'auth-int' won't make it into the first version.
*
* @var array
*/
protected $_supportedQops = array('auth');

/**
* Whether or not to do Proxy Authentication instead of origin server
* authentication (send 407's instead of 401's). Off by default.
*
* @var boolean
*/
protected $_imaProxy;

/**
* Flag indicating the client is IE and didn't bother to return the opaque string
*
* @var boolean
*/
protected $_ieNoOpaque;

/**
* Constructor
*
* @param array $config Configuration settings:
* 'accept_schemes' => 'basic'|'digest'|'basic digest'
* 'realm' => <string>
* 'digest_domains' => <string> Space-delimited list of URIs
* 'nonce_timeout' => <int>
* 'use_opaque' => <bool> Whether to send the opaque value in the header
* 'alogrithm' => <string> See $_supportedAlgos. Default: MD5
* 'proxy_auth' => <bool> Whether to do authentication as a Proxy
* @throws Zend_Auth_Adapter_Exception
* @return void
*/
public function __construct(array $config)
{
if (!extension_loaded('hash')) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception(__CLASS__ . ' requires the \'hash\' extension');
}

$this->_request = null;
$this->_response = null;
$this->_ieNoOpaque = false;


if (empty($config['accept_schemes'])) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('Config key \'accept_schemes\' is required');
}

$schemes = explode(' ', $config['accept_schemes']);
$this->_acceptSchemes = array_intersect($schemes, $this->_supportedSchemes);
if (empty($this->_acceptSchemes)) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('No supported schemes given in \'accept_schemes\'. Valid values: '
. implode(', ', $this->_supportedSchemes));
}

// Double-quotes are used to delimit the realm string in the HTTP header,
// and colons are field delimiters in the password file.
if (empty($config['realm']) ||
!ctype_print($config['realm']) ||
strpos($config['realm'], ':') !== false ||
strpos($config['realm'], '"') !== false) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('Config key \'realm\' is required, and must contain only printable '
. 'characters, excluding quotation marks and colons');
} else {
$this->_realm = $config['realm'];
}

if (in_array('digest', $this->_acceptSchemes)) {
if (empty($config['digest_domains']) ||
!ctype_print($config['digest_domains']) ||
strpos($config['digest_domains'], '"') !== false) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('Config key \'digest_domains\' is required, and must contain '
. 'only printable characters, excluding quotation marks');
} else {
$this->_domains = $config['digest_domains'];
}

if (empty($config['nonce_timeout']) ||
!is_numeric($config['nonce_timeout'])) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('Config key \'nonce_timeout\' is required, and must be an '
. 'integer');
} else {
$this->_nonceTimeout = (int) $config['nonce_timeout'];
}

// We use the opaque value unless explicitly told not to
if (isset($config['use_opaque']) && false == (bool) $config['use_opaque']) {
$this->_useOpaque = false;
} else {
$this->_useOpaque = true;
}

if (isset($config['algorithm']) && in_array($config['algorithm'], $this->_supportedAlgos)) {
$this->_algo = $config['algorithm'];
} else {
$this->_algo = 'MD5';
}
}

// Don't be a proxy unless explicitly told to do so
if (isset($config['proxy_auth']) && true == (bool) $config['proxy_auth']) {
$this->_imaProxy = true; // I'm a Proxy
} else {
$this->_imaProxy = false;
}
}

/**
* Setter for the _basicResolver property
*
* @param Zend_Auth_Adapter_Http_Resolver_Interface $resolver
* @return Zend_Auth_Adapter_Http Provides a fluent interface
*/
public function setBasicResolver(Zend_Auth_Adapter_Http_Resolver_Interface $resolver)
{
$this->_basicResolver = $resolver;

return $this;
}

/**
* Getter for the _basicResolver property
*
* @return Zend_Auth_Adapter_Http_Resolver_Interface
*/
public function getBasicResolver()
{
return $this->_basicResolver;
}

/**
* Setter for the _digestResolver property
*
* @param Zend_Auth_Adapter_Http_Resolver_Interface $resolver
* @return Zend_Auth_Adapter_Http Provides a fluent interface
*/
public function setDigestResolver(Zend_Auth_Adapter_Http_Resolver_Interface $resolver)
{
$this->_digestResolver = $resolver;

return $this;
}

/**
* Getter for the _digestResolver property
*
* @return Zend_Auth_Adapter_Http_Resolver_Interface
*/
public function getDigestResolver()
{
return $this->_digestResolver;
}

/**
* Setter for the Request object
*
* @param Zend_Controller_Request_Http $request
* @return Zend_Auth_Adapter_Http Provides a fluent interface
*/
public function setRequest(Zend_Controller_Request_Http $request)
{
$this->_request = $request;

return $this;
}

/**
* Getter for the Request object
*
* @return Zend_Controller_Request_Http
*/
public function getRequest()
{
return $this->_request;
}

/**
* Setter for the Response object
*
* @param Zend_Controller_Response_Http $response
* @return Zend_Auth_Adapter_Http Provides a fluent interface
*/
public function setResponse(Zend_Controller_Response_Http $response)
{
$this->_response = $response;

return $this;
}

/**
* Getter for the Response object
*
* @return Zend_Controller_Response_Http
*/
public function getResponse()
{
return $this->_response;
}

/**
* Authenticate
*
* @throws Zend_Auth_Adapter_Exception
* @return Zend_Auth_Result
*/
public function authenticate()
{
if (empty($this->_request) ||
empty($this->_response)) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('Request and Response objects must be set before calling '
. 'authenticate()');
}

if ($this->_imaProxy) {
$getHeader = 'Proxy-Authorization';
} else {
$getHeader = 'Authorization';
}

$authHeader = $this->_request->getHeader($getHeader);
if (!$authHeader) {
return $this->_challengeClient();
}

list($clientScheme) = explode(' ', $authHeader);
$clientScheme = strtolower($clientScheme);

// The server can issue multiple challenges, but the client should
// answer with only the selected auth scheme.
if (!in_array($clientScheme, $this->_supportedSchemes)) {
$this->_response->setHttpResponseCode(400);
return new Zend_Auth_Result(
Zend_Auth_Result::FAILURE_UNCATEGORIZED,
array(),
array('Client requested an incorrect or unsupported authentication scheme')
);
}

// client sent a scheme that is not the one required
if (!in_array($clientScheme, $this->_acceptSchemes)) {
// challenge again the client
return $this->_challengeClient();
}
switch ($clientScheme) {
case 'basic':
$result = $this->_basicAuth($authHeader);
break;
case 'digest':
$result = $this->_digestAuth($authHeader);
break;
default:
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('Unsupported authentication scheme');
}

return $result;
}

/**
* Challenge Client
*
* Sets a 401 or 407 Unauthorized response code, and creates the
* appropriate Authenticate header(s) to prompt for credentials.
*
* @return Zend_Auth_Result Always returns a non-identity Auth result
*/
protected function _challengeClient()
{
if ($this->_imaProxy) {
$statusCode = 407;
$headerName = 'Proxy-Authenticate';
} else {
$statusCode = 401;
$headerName = 'WWW-Authenticate';
}

$this->_response->setHttpResponseCode($statusCode);

// Send a challenge in each acceptable authentication scheme
if (in_array('basic', $this->_acceptSchemes)) {
$this->_response->setHeader($headerName, $this->_basicHeader());
}
if (in_array('digest', $this->_acceptSchemes)) {
$this->_response->setHeader($headerName, $this->_digestHeader());
}
return new Zend_Auth_Result(
Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID,
array(),
array('Invalid or absent credentials; challenging client')
);
}

/**
* Basic Header
*
* Generates a Proxy- or WWW-Authenticate header value in the Basic
* authentication scheme.
*
* @return string Authenticate header value
*/
protected function _basicHeader()
{
return 'Basic realm="' . $this->_realm . '"';
}

/**
* Digest Header
*
* Generates a Proxy- or WWW-Authenticate header value in the Digest
* authentication scheme.
*
* @return string Authenticate header value
*/
protected function _digestHeader()
{
$wwwauth = 'Digest realm="' . $this->_realm . '", '
. 'domain="' . $this->_domains . '", '
. 'nonce="' . $this->_calcNonce() . '", '
. ($this->_useOpaque ? 'opaque="' . $this->_calcOpaque() . '", ' : '')
. 'algorithm="' . $this->_algo . '", '
. 'qop="' . implode(',', $this->_supportedQops) . '"';

return $wwwauth;
}

/**
* Basic Authentication
*
* @param string $header Client's Authorization header
* @throws Zend_Auth_Adapter_Exception
* @return Zend_Auth_Result
*/
protected function _basicAuth($header)
{
if (empty($header)) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('The value of the client Authorization header is required');
}
if (empty($this->_basicResolver)) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('A basicResolver object must be set before doing Basic '
. 'authentication');
}

// Decode the Authorization header
$auth = substr($header, strlen('Basic '));
$auth = base64_decode($auth);
if (!$auth) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('Unable to base64_decode Authorization header value');
}

// See ZF-1253. Validate the credentials the same way the digest
// implementation does. If invalid credentials are detected,
// re-challenge the client.
if (!ctype_print($auth)) {
return $this->_challengeClient();
}
// Fix for ZF-1515: Now re-challenges on empty username or password
$creds = array_filter(explode(':', $auth));
if (count($creds) != 2) {
return $this->_challengeClient();
}

$password = $this->_basicResolver->resolve($creds[0], $this->_realm);
if ($password && $password == $creds[1]) {
$identity = array('username'=>$creds[0], 'realm'=>$this->_realm);
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $identity);
} else {
return $this->_challengeClient();
}
}

/**
* Digest Authentication
*
* @param string $header Client's Authorization header
* @throws Zend_Auth_Adapter_Exception
* @return Zend_Auth_Result Valid auth result only on successful auth
*/
protected function _digestAuth($header)
{
if (empty($header)) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('The value of the client Authorization header is required');
}
if (empty($this->_digestResolver)) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('A digestResolver object must be set before doing Digest authentication');
}

$data = $this->_parseDigestAuth($header);
if ($data === false) {
$this->_response->setHttpResponseCode(400);
return new Zend_Auth_Result(
Zend_Auth_Result::FAILURE_UNCATEGORIZED,
array(),
array('Invalid Authorization header format')
);
}

// See ZF-1052. This code was a bit too unforgiving of invalid
// usernames. Now, if the username is bad, we re-challenge the client.
if ('::invalid::' == $data['username']) {
return $this->_challengeClient();
}

// Verify that the client sent back the same nonce
if ($this->_calcNonce() != $data['nonce']) {
return $this->_challengeClient();
}
// The opaque value is also required to match, but of course IE doesn't
// play ball.
if (!$this->_ieNoOpaque && $this->_calcOpaque() != $data['opaque']) {
return $this->_challengeClient();
}

// Look up the user's password hash. If not found, deny access.
// This makes no assumptions about how the password hash was
// constructed beyond that it must have been built in such a way as
// to be recreatable with the current settings of this object.
$ha1 = $this->_digestResolver->resolve($data['username'], $data['realm']);
if ($ha1 === false) {
return $this->_challengeClient();
}

// If MD5-sess is used, a1 value is made of the user's password
// hash with the server and client nonce appended, separated by
// colons.
if ($this->_algo == 'MD5-sess') {
$ha1 = hash('md5', $ha1 . ':' . $data['nonce'] . ':' . $data['cnonce']);
}

// Calculate h(a2). The value of this hash depends on the qop
// option selected by the client and the supported hash functions
switch ($data['qop']) {
case 'auth':
$a2 = $this->_request->getMethod() . ':' . $data['uri'];
break;
case 'auth-int':
// Should be REQUEST_METHOD . ':' . uri . ':' . hash(entity-body),
// but this isn't supported yet, so fall through to default case
default:
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('Client requested an unsupported qop option');
}
// Using hash() should make parameterizing the hash algorithm
// easier
$ha2 = hash('md5', $a2);


// Calculate the server's version of the request-digest. This must
// match $data['response']. See RFC 2617, section 3.2.2.1
$message = $data['nonce'] . ':' . $data['nc'] . ':' . $data['cnonce'] . ':' . $data['qop'] . ':' . $ha2;
$digest = hash('md5', $ha1 . ':' . $message);

// If our digest matches the client's let them in, otherwise return
// a 401 code and exit to prevent access to the protected resource.
if ($digest == $data['response']) {
$identity = array('username'=>$data['username'], 'realm'=>$data['realm']);
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $identity);
} else {
return $this->_challengeClient();
}
}

/**
* Calculate Nonce
*
* @return string The nonce value
*/
protected function _calcNonce()
{
// Once subtle consequence of this timeout calculation is that it
// actually divides all of time into _nonceTimeout-sized sections, such
// that the value of timeout is the point in time of the next
// approaching "boundary" of a section. This allows the server to
// consistently generate the same timeout (and hence the same nonce
// value) across requests, but only as long as one of those
// "boundaries" is not crossed between requests. If that happens, the
// nonce will change on its own, and effectively log the user out. This
// would be surprising if the user just logged in.
$timeout = ceil(time() / $this->_nonceTimeout) * $this->_nonceTimeout;

$nonce = hash('md5', $timeout . ':' . $this->_request->getServer('HTTP_USER_AGENT') . ':' . __CLASS__);
return $nonce;
}

/**
* Calculate Opaque
*
* The opaque string can be anything; the client must return it exactly as
* it was sent. It may be useful to store data in this string in some
* applications. Ideally, a new value for this would be generated each time
* a WWW-Authenticate header is sent (in order to reduce predictability),
* but we would have to be able to create the same exact value across at
* least two separate requests from the same client.
*
* @return string The opaque value
*/
protected function _calcOpaque()
{
return hash('md5', 'Opaque Data:' . __CLASS__);
}

/**
* Parse Digest Authorization header
*
* @param string $header Client's Authorization: HTTP header
* @return array|false Data elements from header, or false if any part of
* the header is invalid
*/
protected function _parseDigestAuth($header)
{
$temp = null;
$data = array();

// See ZF-1052. Detect invalid usernames instead of just returning a
// 400 code.
$ret = preg_match('/username="([^"]+)"/', $header, $temp);
if (!$ret || empty($temp[1])
|| !ctype_print($temp[1])
|| strpos($temp[1], ':') !== false) {
$data['username'] = '::invalid::';
} else {
$data['username'] = $temp[1];
}
$temp = null;

$ret = preg_match('/realm="([^"]+)"/', $header, $temp);
if (!$ret || empty($temp[1])) {
return false;
}
if (!ctype_print($temp[1]) || strpos($temp[1], ':') !== false) {
return false;
} else {
$data['realm'] = $temp[1];
}
$temp = null;

$ret = preg_match('/nonce="([^"]+)"/', $header, $temp);
if (!$ret || empty($temp[1])) {
return false;
}
if (!ctype_xdigit($temp[1])) {
return false;
} else {
$data['nonce'] = $temp[1];
}
$temp = null;

$ret = preg_match('/uri="([^"]+)"/', $header, $temp);
if (!$ret || empty($temp[1])) {
return false;
}
// Section 3.2.2.5 in RFC 2617 says the authenticating server must
// verify that the URI field in the Authorization header is for the
// same resource requested in the Request Line.
$rUri = @parse_url($this->_request->getRequestUri());
$cUri = @parse_url($temp[1]);
if (false === $rUri || false === $cUri) {
return false;
} else {
// Make sure the path portion of both URIs is the same
if ($rUri['path'] != $cUri['path']) {
return false;
}
// Section 3.2.2.5 seems to suggest that the value of the URI
// Authorization field should be made into an absolute URI if the
// Request URI is absolute, but it's vague, and that's a bunch of
// code I don't want to write right now.
$data['uri'] = $temp[1];
}
$temp = null;

$ret = preg_match('/response="([^"]+)"/', $header, $temp);
if (!$ret || empty($temp[1])) {
return false;
}
if (32 != strlen($temp[1]) || !ctype_xdigit($temp[1])) {
return false;
} else {
$data['response'] = $temp[1];
}
$temp = null;

// The spec says this should default to MD5 if omitted. OK, so how does
// that square with the algo we send out in the WWW-Authenticate header,
// if it can easily be overridden by the client?
$ret = preg_match('/algorithm="?(' . $this->_algo . ')"?/', $header, $temp);
if ($ret && !empty($temp[1])
&& in_array($temp[1], $this->_supportedAlgos)) {
$data['algorithm'] = $temp[1];
} else {
$data['algorithm'] = 'MD5'; // = $this->_algo; ?
}
$temp = null;

// Not optional in this implementation
$ret = preg_match('/cnonce="([^"]+)"/', $header, $temp);
if (!$ret || empty($temp[1])) {
return false;
}
if (!ctype_print($temp[1])) {
return false;
} else {
$data['cnonce'] = $temp[1];
}
$temp = null;

// If the server sent an opaque value, the client must send it back
if ($this->_useOpaque) {
$ret = preg_match('/opaque="([^"]+)"/', $header, $temp);
if (!$ret || empty($temp[1])) {

// Big surprise: IE isn't RFC 2617-compliant.
if (false !== strpos($this->_request->getHeader('User-Agent'), 'MSIE')) {
$temp[1] = '';
$this->_ieNoOpaque = true;
} else {
return false;
}
}
// This implementation only sends MD5 hex strings in the opaque value
if (!$this->_ieNoOpaque &&
(32 != strlen($temp[1]) || !ctype_xdigit($temp[1]))) {
return false;
} else {
$data['opaque'] = $temp[1];
}
$temp = null;
}

// Not optional in this implementation, but must be one of the supported
// qop types
$ret = preg_match('/qop="?(' . implode('|', $this->_supportedQops) . ')"?/', $header, $temp);
if (!$ret || empty($temp[1])) {
return false;
}
if (!in_array($temp[1], $this->_supportedQops)) {
return false;
} else {
$data['qop'] = $temp[1];
}
$temp = null;

// Not optional in this implementation. The spec says this value
// shouldn't be a quoted string, but apparently some implementations
// quote it anyway. See ZF-1544.
$ret = preg_match('/nc="?([0-9A-Fa-f]{8})"?/', $header, $temp);
if (!$ret || empty($temp[1])) {
return false;
}
if (8 != strlen($temp[1]) || !ctype_xdigit($temp[1])) {
return false;
} else {
$data['nc'] = $temp[1];
}
$temp = null;

return $data;
}
}

View File

@ -0,0 +1,40 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter_Http
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 8862 2008-03-16 15:36:00Z thomas $
*/


/**
* @see Zend_Auth_Exception
*/
require_once 'Zend/Auth/Exception.php';


/**
* HTTP Auth Resolver Exception
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter_Http
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Auth_Adapter_Http_Resolver_Exception extends Zend_Auth_Exception
{}

View File

@ -0,0 +1,167 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter_Http
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: File.php 8862 2008-03-16 15:36:00Z thomas $
*/


/**
* @see Zend_Auth_Adapter_Http_Resolver_Interface
*/
require_once 'Zend/Auth/Adapter/Http/Resolver/Interface.php';


/**
* HTTP Authentication File Resolver
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter_Http
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Auth_Adapter_Http_Resolver_File implements Zend_Auth_Adapter_Http_Resolver_Interface
{
/**
* Path to credentials file
*
* @var string
*/
protected $_file;

/**
* Constructor
*
* @param string $path Complete filename where the credentials are stored
* @return void
*/
public function __construct($path = '')
{
if (!empty($path)) {
$this->setFile($path);
}
}

/**
* Set the path to the credentials file
*
* @param string $path
* @throws Zend_Auth_Adapter_Http_Resolver_Exception
* @return Zend_Auth_Adapter_Http_Resolver_File Provides a fluent interface
*/
public function setFile($path)
{
if (empty($path) || !is_readable($path)) {
/**
* @see Zend_Auth_Adapter_Http_Resolver_Exception
*/
require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php';
throw new Zend_Auth_Adapter_Http_Resolver_Exception('Path not readable: ' . $path);
}
$this->_file = $path;

return $this;
}

/**
* Returns the path to the credentials file
*
* @return string
*/
public function getFile()
{
return $this->_file;
}

/**
* Resolve credentials
*
* Only the first matching username/realm combination in the file is
* returned. If the file contains credentials for Digest authentication,
* the returned string is the password hash, or h(a1) from RFC 2617. The
* returned string is the plain-text password for Basic authentication.
*
* The expected format of the file is:
* username:realm:sharedSecret
*
* That is, each line consists of the user's username, the applicable
* authentication realm, and the password or hash, each delimited by
* colons.
*
* @param string $username Username
* @param string $realm Authentication Realm
* @throws Zend_Auth_Adapter_Http_Resolver_Exception
* @return string|false User's shared secret, if the user is found in the
* realm, false otherwise.
*/
public function resolve($username, $realm)
{
if (empty($username)) {
/**
* @see Zend_Auth_Adapter_Http_Resolver_Exception
*/
require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php';
throw new Zend_Auth_Adapter_Http_Resolver_Exception('Username is required');
} else if (!ctype_print($username) || strpos($username, ':') !== false) {
/**
* @see Zend_Auth_Adapter_Http_Resolver_Exception
*/
require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php';
throw new Zend_Auth_Adapter_Http_Resolver_Exception('Username must consist only of printable characters, '
. 'excluding the colon');
}
if (empty($realm)) {
/**
* @see Zend_Auth_Adapter_Http_Resolver_Exception
*/
require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php';
throw new Zend_Auth_Adapter_Http_Resolver_Exception('Realm is required');
} else if (!ctype_print($realm) || strpos($realm, ':') !== false) {
/**
* @see Zend_Auth_Adapter_Http_Resolver_Exception
*/
require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php';
throw new Zend_Auth_Adapter_Http_Resolver_Exception('Realm must consist only of printable characters, '
. 'excluding the colon.');
}

// Open file, read through looking for matching credentials
$fp = @fopen($this->_file, 'r');
if (!$fp) {
/**
* @see Zend_Auth_Adapter_Http_Resolver_Exception
*/
require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php';
throw new Zend_Auth_Adapter_Http_Resolver_Exception('Unable to open password file: ' . $this->_file);
}

// No real validation is done on the contents of the password file. The
// assumption is that we trust the administrators to keep it secure.
while (($line = fgetcsv($fp, 512, ':')) !== false) {
if ($line[0] == $username && $line[1] == $realm) {
$password = $line[2];
fclose($fp);
return $password;
}
}

fclose($fp);
return false;
}
}

View File

@ -0,0 +1,47 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter_Http
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Interface.php 8862 2008-03-16 15:36:00Z thomas $
*/


/**
* Auth HTTP Resolver Interface
*
* Defines an interace to resolve a username/realm combination into a shared
* secret usable by HTTP Authentication.
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter_Http
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Auth_Adapter_Http_Resolver_Interface
{
/**
* Resolve username/realm to password/hash/etc.
*
* @param string $username Username
* @param string $realm Authentication Realm
* @return string|false User's shared secret, if the user is found in the
* realm, false otherwise.
*/
public function resolve($username, $realm);
}

View File

@ -0,0 +1,261 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: InfoCard.php 9094 2008-03-30 18:36:55Z thomas $
*/

/**
* @see Zend_Auth_Adapter_Interface
*/
require_once 'Zend/Auth/Adapter/Interface.php';

/**
* @see Zend_Auth_Result
*/
require_once 'Zend/Auth/Result.php';

/**
* @see Zend_InfoCard
*/
require_once 'Zend/InfoCard.php';

/**
* A Zend_Auth Authentication Adapter allowing the use of Information Cards as an
* authentication mechanism
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Auth_Adapter_InfoCard implements Zend_Auth_Adapter_Interface
{
/**
* The XML Token being authenticated
*
* @var string
*/
protected $_xmlToken;

/**
* The instance of Zend_InfoCard
*
* @var Zend_InfoCard
*/
protected $_infoCard;

/**
* Constructor
*
* @param string $strXmlDocument The XML Token provided by the client
* @return void
*/
public function __construct($strXmlDocument)
{
$this->_xmlToken = $strXmlDocument;
$this->_infoCard = new Zend_InfoCard();
}

/**
* Sets the InfoCard component Adapter to use
*
* @param Zend_InfoCard_Adapter_Interface $a
* @return Zend_Auth_Adapter_InfoCard Provides a fluent interface
*/
public function setAdapter(Zend_InfoCard_Adapter_Interface $a)
{
$this->_infoCard->setAdapter($a);
return $this;
}

/**
* Retrieves the InfoCard component adapter being used
*
* @return Zend_InfoCard_Adapter_Interface
*/
public function getAdapter()
{
return $this->_infoCard->getAdapter();
}

/**
* Retrieves the InfoCard public key cipher object being used
*
* @return Zend_InfoCard_Cipher_PKI_Interface
*/
public function getPKCipherObject()
{
return $this->_infoCard->getPKCipherObject();
}

/**
* Sets the InfoCard public key cipher object to use
*
* @param Zend_InfoCard_Cipher_PKI_Interface $cipherObj
* @return Zend_Auth_Adapter_InfoCard Provides a fluent interface
*/
public function setPKICipherObject(Zend_InfoCard_Cipher_PKI_Interface $cipherObj)
{
$this->_infoCard->setPKICipherObject($cipherObj);
return $this;
}

/**
* Retrieves the Symmetric cipher object being used
*
* @return Zend_InfoCard_Cipher_Symmetric_Interface
*/
public function getSymCipherObject()
{
return $this->_infoCard->getSymCipherObject();
}

/**
* Sets the InfoCard symmetric cipher object to use
*
* @param Zend_InfoCard_Cipher_Symmetric_Interface $cipherObj
* @return Zend_Auth_Adapter_InfoCard Provides a fluent interface
*/
public function setSymCipherObject(Zend_InfoCard_Cipher_Symmetric_Interface $cipherObj)
{
$this->_infoCard->setSymCipherObject($cipherObj);
return $this;
}

/**
* Remove a Certificate Pair by Key ID from the search list
*
* @param string $key_id The Certificate Key ID returned from adding the certificate pair
* @throws Zend_InfoCard_Exception
* @return Zend_Auth_Adapter_InfoCard Provides a fluent interface
*/
public function removeCertificatePair($key_id)
{
$this->_infoCard->removeCertificatePair($key_id);
return $this;
}

/**
* Add a Certificate Pair to the list of certificates searched by the component
*
* @param string $private_key_file The path to the private key file for the pair
* @param string $public_key_file The path to the certificate / public key for the pair
* @param string $type (optional) The URI for the type of key pair this is (default RSA with OAEP padding)
* @param string $password (optional) The password for the private key file if necessary
* @throws Zend_InfoCard_Exception
* @return string A key ID representing this key pair in the component
*/
public function addCertificatePair($private_key_file, $public_key_file, $type = Zend_InfoCard_Cipher::ENC_RSA_OAEP_MGF1P, $password = null)
{
return $this->_infoCard->addCertificatePair($private_key_file, $public_key_file, $type, $password);
}

/**
* Return a Certificate Pair from a key ID
*
* @param string $key_id The Key ID of the certificate pair in the component
* @throws Zend_InfoCard_Exception
* @return array An array containing the path to the private/public key files,
* the type URI and the password if provided
*/
public function getCertificatePair($key_id)
{
return $this->_infoCard->getCertificatePair($key_id);
}

/**
* Set the XML Token to be processed
*
* @param string $strXmlToken The XML token to process
* @return Zend_Auth_Adapter_InfoCard Provides a fluent interface
*/
public function setXmlToken($strXmlToken)
{
$this->_xmlToken = $strXmlToken;
return $this;
}

/**
* Get the XML Token being processed
*
* @return string The XML token to be processed
*/
public function getXmlToken()
{
return $this->_xmlToken;
}

/**
* Authenticates the XML token
*
* @return Zend_Auth_Result The result of the authentication
*/
public function authenticate()
{
try {
$claims = $this->_infoCard->process($this->getXmlToken());
} catch(Exception $e) {
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE , null, array('Exception Thrown',
$e->getMessage(),
$e->getTraceAsString(),
serialize($e)));
}

if(!$claims->isValid()) {
switch($claims->getCode()) {
case Zend_infoCard_Claims::RESULT_PROCESSING_FAILURE:
return new Zend_Auth_Result(
Zend_Auth_Result::FAILURE,
$claims,
array(
'Processing Failure',
$claims->getErrorMsg()
)
);
break;
case Zend_InfoCard_Claims::RESULT_VALIDATION_FAILURE:
return new Zend_Auth_Result(
Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID,
$claims,
array(
'Validation Failure',
$claims->getErrorMsg()
)
);
break;
default:
return new Zend_Auth_Result(
Zend_Auth_Result::FAILURE,
$claims,
array(
'Unknown Failure',
$claims->getErrorMsg()
)
);
break;
}
}

return new Zend_Auth_Result(
Zend_Auth_Result::SUCCESS,
$claims
);
}
}

View File

@ -0,0 +1,46 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Interface.php 8862 2008-03-16 15:36:00Z thomas $
*/


/**
* @see Zend_Auth_Result
*/
require_once 'Zend/Auth/Result.php';


/**
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Auth_Adapter_Interface
{
/**
* Performs an authentication attempt
*
* @throws Zend_Auth_Adapter_Exception If authentication cannot be performed
* @return Zend_Auth_Result
*/
public function authenticate();
}

View File

@ -0,0 +1,329 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Ldap.php 11765 2008-10-09 01:53:43Z miallen $
*/

/**
* @see Zend_Auth_Adapter_Interface
*/
require_once 'Zend/Auth/Adapter/Interface.php';

/**
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface
{

/**
* The Zend_Ldap context.
*
* @var Zend_Ldap
*/
protected $_ldap = null;

/**
* The array of arrays of Zend_Ldap options passed to the constructor.
*
* @var array
*/
protected $_options = null;

/**
* The username of the account being authenticated.
*
* @var string
*/
protected $_username = null;

/**
* The password of the account being authenticated.
*
* @var string
*/
protected $_password = null;

/**
* Constructor
*
* @param array $options An array of arrays of Zend_Ldap options
* @param string $username The username of the account being authenticated
* @param string $password The password of the account being authenticated
* @return void
*/
public function __construct(array $options = array(), $username = null, $password = null)
{
$this->setOptions($options);
if ($username !== null) {
$this->setUsername($username);
}
if ($password !== null) {
$this->setPassword($password);
}
}

/**
* Returns the array of arrays of Zend_Ldap options of this adapter.
*
* @return array|null
*/
public function getOptions()
{
return $this->_options;
}

/**
* Sets the array of arrays of Zend_Ldap options to be used by
* this adapter.
*
* @param array $options The array of arrays of Zend_Ldap options
* @return Zend_Auth_Adapter_Ldap Provides a fluent interface
*/
public function setOptions($options)
{
$this->_options = is_array($options) ? $options : array();
return $this;
}

/**
* Returns the username of the account being authenticated, or
* NULL if none is set.
*
* @return string|null
*/
public function getUsername()
{
return $this->_username;
}

/**
* Sets the username for binding
*
* @param string $username The username for binding
* @return Zend_Auth_Adapter_Ldap Provides a fluent interface
*/
public function setUsername($username)
{
$this->_username = (string) $username;
return $this;
}

/**
* Returns the password of the account being authenticated, or
* NULL if none is set.
*
* @return string|null
*/
public function getPassword()
{
return $this->_password;
}

/**
* Sets the passwort for the account
*
* @param string $password The password of the account being authenticated
* @return Zend_Auth_Adapter_Ldap Provides a fluent interface
*/
public function setPassword($password)
{
$this->_password = (string) $password;
return $this;
}

/**
* Returns the LDAP Object
*
* @return Zend_Ldap The Zend_Ldap object used to authenticate the credentials
*/
public function getLdap()
{
if ($this->_ldap === null) {
/**
* @see Zend_Ldap
*/
require_once 'Zend/Ldap.php';
$this->_ldap = new Zend_Ldap();
}
return $this->_ldap;
}

/**
* Returns a domain name for the current LDAP options. This is used
* for skipping redundant operations (e.g. authentications).
*
* @return string
*/
protected function _getAuthorityName()
{
$options = $this->getLdap()->getOptions();
$name = $options['accountDomainName'];
if (!$name)
$name = $options['accountDomainNameShort'];
return $name ? $name : '';
}

/**
* Authenticate the user
*
* @throws Zend_Auth_Adapter_Exception
* @return Zend_Auth_Result
*/
public function authenticate()
{
/**
* @see Zend_Ldap_Exception
*/
require_once 'Zend/Ldap/Exception.php';

$messages = array();
$messages[0] = ''; // reserved
$messages[1] = ''; // reserved

$username = $this->_username;
$password = $this->_password;

if (!$username) {
$code = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND;
$messages[0] = 'A username is required';
return new Zend_Auth_Result($code, '', $messages);
}
if (!$password) {
/* A password is required because some servers will
* treat an empty password as an anonymous bind.
*/
$code = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;
$messages[0] = 'A password is required';
return new Zend_Auth_Result($code, '', $messages);
}

$ldap = $this->getLdap();

$code = Zend_Auth_Result::FAILURE;
$messages[0] = "Authority not found: $username";
$failedAuthorities = array();

/* Iterate through each server and try to authenticate the supplied
* credentials against it.
*/
foreach ($this->_options as $name => $options) {

if (!is_array($options)) {
/**
* @see Zend_Auth_Adapter_Exception
*/
require_once 'Zend/Auth/Adapter/Exception.php';
throw new Zend_Auth_Adapter_Exception('Adapter options array not in array');
}
$ldap->setOptions($options);
$dname = '';

try {
if ($messages[1])
$messages[] = $messages[1];
$messages[1] = '';
$messages[] = $this->_optionsToString($options);

$dname = $this->_getAuthorityName();
if (isset($failedAuthorities[$dname])) {
/* If multiple sets of server options for the same domain
* are supplied, we want to skip redundant authentications
* where the identity or credentials where found to be
* invalid with another server for the same domain. The
* $failedAuthorities array tracks this condition (and also
* serves to supply the original error message).
* This fixes issue ZF-4093.
*/
$messages[1] = $failedAuthorities[$dname];
$messages[] = "Skipping previously failed authority: $dname";
continue;
}

$canonicalName = $ldap->getCanonicalAccountName($username);

$ldap->bind($canonicalName, $password);

$messages[0] = '';
$messages[1] = '';
$messages[] = "$canonicalName authentication successful";

return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $canonicalName, $messages);
} catch (Zend_Ldap_Exception $zle) {

/* LDAP based authentication is notoriously difficult to diagnose. Therefore
* we bend over backwards to capture and record every possible bit of
* information when something goes wrong.
*/

$err = $zle->getCode();

if ($err == Zend_Ldap_Exception::LDAP_X_DOMAIN_MISMATCH) {
/* This error indicates that the domain supplied in the
* username did not match the domains in the server options
* and therefore we should just skip to the next set of
* server options.
*/
continue;
} else if ($err == Zend_Ldap_Exception::LDAP_NO_SUCH_OBJECT) {
$code = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND;
$messages[0] = "Account not found: $username";
$failedAuthorities[$dname] = $zle->getMessage();
} else if ($err == Zend_Ldap_Exception::LDAP_INVALID_CREDENTIALS) {
$code = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;
$messages[0] = 'Invalid credentials';
$failedAuthorities[$dname] = $zle->getMessage();
} else {
$line = $zle->getLine();
$messages[] = $zle->getFile() . "($line): " . $zle->getMessage();
$messages[] = str_replace($password, '*****', $zle->getTraceAsString());
$messages[0] = 'An unexpected failure occurred';
}
$messages[1] = $zle->getMessage();
}
}

$msg = isset($messages[1]) ? $messages[1] : $messages[0];
$messages[] = "$username authentication failed: $msg";

return new Zend_Auth_Result($code, $username, $messages);
}

/**
* Converts options to string
*
* @param array $options
* @return string
*/
private function _optionsToString(array $options)
{
$str = '';
foreach ($options as $key => $val) {
if ($key === 'password')
$val = '*****';
if ($str)
$str .= ',';
$str .= $key . '=' . $val;
}
return $str;
}
}

View File

@ -0,0 +1,284 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: OpenId.php 12519 2008-11-10 18:41:24Z alexander $
*/


/**
* @see Zend_Auth_Adapter_Interface
*/
require_once 'Zend/Auth/Adapter/Interface.php';


/**
* @see Zend_OpenId_Consumer
*/
require_once 'Zend/OpenId/Consumer.php';


/**
* A Zend_Auth Authentication Adapter allowing the use of OpenID protocol as an
* authentication mechanism
*
* @category Zend
* @package Zend_Auth
* @subpackage Zend_Auth_Adapter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Auth_Adapter_OpenId implements Zend_Auth_Adapter_Interface
{
/**
* The identity value being authenticated
*
* @var string
*/
private $_id = null;

/**
* Reference to an implementation of a storage object
*
* @var Zend_OpenId_Consumer_Storage
*/
private $_storage = null;

/**
* The URL to redirect response from server to
*
* @var string
*/
private $_returnTo = null;

/**
* The HTTP URL to identify consumer on server
*
* @var string
*/
private $_root = null;

/**
* Extension object or array of extensions objects
*
* @var string
*/
private $_extensions = null;

/**
* The response object to perform HTTP or HTML form redirection
*
* @var Zend_Controller_Response_Abstract
*/
private $_response = null;

/**
* Enables or disables interaction with user during authentication on
* OpenID provider.
*
* @var bool
*/
private $_check_immediate = false;

/**
* HTTP client to make HTTP requests
*
* @var Zend_Http_Client $_httpClient
*/
private $_httpClient = null;

/**
* Constructor
*
* @param string $id the identity value
* @param Zend_OpenId_Consumer_Storage $storage an optional implementation
* of a storage object
* @param string $returnTo HTTP URL to redirect response from server to
* @param string $root HTTP URL to identify consumer on server
* @param mixed $extensions extension object or array of extensions objects
* @param Zend_Controller_Response_Abstract $response an optional response
* object to perform HTTP or HTML form redirection
* @return void
*/
public function __construct($id = null,
Zend_OpenId_Consumer_Storage $storage = null,
$returnTo = null,
$root = null,
$extensions = null,
Zend_Controller_Response_Abstract $response = null) {
$this->_id = $id;
$this->_storage = $storage;
$this->_returnTo = $returnTo;
$this->_root = $root;
$this->_extensions = $extensions;
$this->_response = $response;
}

/**
* Sets the value to be used as the identity
*
* @param string $id the identity value
* @return Zend_Auth_Adapter_OpenId Provides a fluent interface
*/
public function setIdentity($id)
{
$this->_id = $id;
return $this;
}

/**
* Sets the storage implementation which will be use by OpenId
*
* @param Zend_OpenId_Consumer_Storage $storage
* @return Zend_Auth_Adapter_OpenId Provides a fluent interface
*/
public function setStorage(Zend_OpenId_Consumer_Storage $storage)
{
$this->_storage = $storage;
return $this;
}

/**
* Sets the HTTP URL to redirect response from server to
*
* @param string $returnTo
* @return Zend_Auth_Adapter_OpenId Provides a fluent interface
*/
public function setReturnTo($returnTo)
{
$this->_returnTo = $returnTo;
return $this;
}

/**
* Sets HTTP URL to identify consumer on server
*
* @param string $root
* @return Zend_Auth_Adapter_OpenId Provides a fluent interface
*/
public function setRoot($root)
{
$this->_root = $root;
return $this;
}

/**
* Sets OpenID extension(s)
*
* @param mixed $extensions
* @return Zend_Auth_Adapter_OpenId Provides a fluent interface
*/
public function setExtensions($extensions)
{
$this->_extensions = $extensions;
return $this;
}

/**
* Sets an optional response object to perform HTTP or HTML form redirection
*
* @param string $root
* @return Zend_Auth_Adapter_OpenId Provides a fluent interface
*/
public function setResponse($response)
{
$this->_response = $response;
return $this;
}

/**
* Enables or disables interaction with user during authentication on
* OpenID provider.
*
* @param bool $check_immediate
* @return Zend_Auth_Adapter_OpenId Provides a fluent interface
*/
public function setCheckImmediate($check_immediate)
{
$this->_check_immediate = $check_immediate;
return $this;
}

/**
* Sets HTTP client object to make HTTP requests
*
* @param Zend_Http_Client $client HTTP client object to be used
*/
public function setHttpClient($client) {
$this->_httpClient = $client;
}

/**
* Authenticates the given OpenId identity.
* Defined by Zend_Auth_Adapter_Interface.
*
* @throws Zend_Auth_Adapter_Exception If answering the authentication query is impossible
* @return Zend_Auth_Result
*/
public function authenticate() {
$id = $this->_id;
if (!empty($id)) {
$consumer = new Zend_OpenId_Consumer($this->_storage);
$consumer->setHttpClient($this->_httpClient);
/* login() is never returns on success */
if (!$this->_check_immediate) {
if (!$consumer->login($id,
$this->_returnTo,
$this->_root,
$this->_extensions,
$this->_response)) {
return new Zend_Auth_Result(
Zend_Auth_Result::FAILURE,
$id,
array("Authentication failed", $consumer->getError()));
}
} else {
if (!$consumer->check($id,
$this->_returnTo,
$this->_root,
$this->_extensions,
$this->_response)) {
return new Zend_Auth_Result(
Zend_Auth_Result::FAILURE,
$id,
array("Authentication failed", $consumer->getError()));
}
}
} else {
$params = (isset($_SERVER['REQUEST_METHOD']) &&
$_SERVER['REQUEST_METHOD']=='POST') ? $_POST: $_GET;
$consumer = new Zend_OpenId_Consumer($this->_storage);
$consumer->setHttpClient($this->_httpClient);
if ($consumer->verify(
$params,
$id,
$this->_extensions)) {
return new Zend_Auth_Result(
Zend_Auth_Result::SUCCESS,
$id,
array("Authentication successful"));
} else {
return new Zend_Auth_Result(
Zend_Auth_Result::FAILURE,
$id,
array("Authentication failed", $consumer->getError()));
}
}
}

}

View File

@ -0,0 +1,36 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Auth
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 8862 2008-03-16 15:36:00Z thomas $
*/


/**
* @see Zend_Exception
*/
require_once 'Zend/Exception.php';


/**
* @category Zend
* @package Zend_Auth
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Auth_Exception extends Zend_Exception
{}

Some files were not shown because too many files have changed in this diff Show More