import v1.0.0-RC4 | 2009-05-20
This commit is contained in:
36
modules/default/controllers/AboutController.php
Normal file
36
modules/default/controllers/AboutController.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?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 AboutController extends Monkeys_Controller_Action
|
||||
{
|
||||
protected $_numCols = 1;
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$scriptsDir = $this->view->getScriptPath('about');
|
||||
|
||||
$locale = Zend_Registry::get('Zend_Locale');
|
||||
// render() changes _ to -
|
||||
$locale = str_replace('_', '-', $locale);
|
||||
$localeElements = explode('-', $locale);
|
||||
|
||||
if (file_exists("$scriptsDir/index-$locale.phtml")) {
|
||||
$view = "index-$locale";
|
||||
} else if (count($localeElements == 2)
|
||||
&& file_exists("$scriptsDir/index-".$localeElements[0].".phtml")) {
|
||||
$view = 'index-'.$localeElements[0];
|
||||
} else {
|
||||
$view = 'index-en';
|
||||
}
|
||||
|
||||
$this->render($view);
|
||||
}
|
||||
}
|
14
modules/default/controllers/ErrorController.php
Executable file
14
modules/default/controllers/ErrorController.php
Executable file
@ -0,0 +1,14 @@
|
||||
<?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 ErrorController extends Monkeys_Controller_Error
|
||||
{
|
||||
}
|
111
modules/default/controllers/FeedbackController.php
Normal file
111
modules/default/controllers/FeedbackController.php
Normal 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
|
||||
*/
|
||||
|
||||
class FeedbackController extends Monkeys_Controller_Action
|
||||
{
|
||||
protected $_numCols = 1;
|
||||
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
if ($this->user->role != User::ROLE_ADMIN && $this->underMaintenance) {
|
||||
return $this->_redirectForMaintenance();
|
||||
}
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$appSession = Zend_Registry::get('appSession');
|
||||
if (isset($appSession->feedbackForm)) {
|
||||
$form = $appSession->feedbackForm;
|
||||
unset($appSession->feedbackForm);
|
||||
} else {
|
||||
$form = new FeedbackForm(null, $this->view->base);
|
||||
}
|
||||
$this->view->form = $form;
|
||||
}
|
||||
|
||||
public function sendAction()
|
||||
{
|
||||
$form = new FeedbackForm(null, $this->view->base);
|
||||
$formData = $this->_request->getPost();
|
||||
$form->populate($formData);
|
||||
|
||||
if (!$form->isValid($formData)) {
|
||||
$appSession = Zend_Registry::get('appSession');
|
||||
$appSession->feedbackForm = $form;
|
||||
return $this->_forward('index', null, null);
|
||||
}
|
||||
|
||||
$mail = self::getMail(
|
||||
$form->getValue('name'),
|
||||
$form->getValue('email'),
|
||||
$form->getValue('feedback')
|
||||
);
|
||||
|
||||
try {
|
||||
$mail->send();
|
||||
$this->_helper->FlashMessenger->addMessage('Thank you for your interest. Your message has been routed.');
|
||||
} catch (Zend_Mail_Protocol_Exception $e) {
|
||||
$this->_helper->FlashMessenger->addMessage('Sorry, the feedback couldn\'t be delivered. Please try again later.');
|
||||
if ($this->_config->logging->level == Zend_Log::DEBUG) {
|
||||
$this->_helper->FlashMessenger->addMessage($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
$this->_redirect('');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Mail
|
||||
* @throws Zend_Mail_Protocol_Exception
|
||||
*/
|
||||
public static function getMail($name, $email, $feedback)
|
||||
{
|
||||
// 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(<<<EOD
|
||||
Dear Administrator,
|
||||
|
||||
The community-id feedback form has just been used to send you the following:
|
||||
|
||||
Name: $name
|
||||
E-mail: $email
|
||||
Feedback:
|
||||
$feedback
|
||||
EOD
|
||||
);
|
||||
$mail->setFrom('support@community-id.org');
|
||||
$mail->addTo($configEmail->supportemail);
|
||||
$mail->setSubject('Community-ID feedback form');
|
||||
|
||||
return $mail;
|
||||
}
|
||||
}
|
64
modules/default/controllers/HistoryController.php
Executable file
64
modules/default/controllers/HistoryController.php
Executable file
@ -0,0 +1,64 @@
|
||||
<?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 HistoryController extends Monkeys_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->actionStack('index', 'login', 'users');
|
||||
}
|
||||
|
||||
public function listAction()
|
||||
{
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$histories = new Histories();
|
||||
$historiesRows = $histories->get(
|
||||
$this->user,
|
||||
$this->_getParam('startIndex'),
|
||||
$this->_getParam('results')
|
||||
);
|
||||
|
||||
$jsonObj = new StdClass();
|
||||
$jsonObj->recordsReturned = count($historiesRows);
|
||||
$jsonObj->totalRecords = $histories->getNumHistories($this->user);
|
||||
$jsonObj->startIndex = $this->_getParam('startIndex');
|
||||
$jsonObj->sort = null;
|
||||
$jsonObj->dir = 'asc';
|
||||
$jsonObj->records = array();
|
||||
|
||||
foreach ($historiesRows as $history) {
|
||||
$jsonObjSite = new StdClass();
|
||||
$jsonObjSite->id = $history->id;
|
||||
$jsonObjSite->date = $history->date;
|
||||
$jsonObjSite->site = $history->site;
|
||||
$jsonObjSite->ip = $history->ip;
|
||||
$jsonObjSite->result = $history->result;
|
||||
|
||||
$jsonObj->records[] = $jsonObjSite;
|
||||
}
|
||||
|
||||
echo Zend_Json::encode($jsonObj);
|
||||
}
|
||||
|
||||
public function clearAction()
|
||||
{
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$histories = new Histories();
|
||||
$histories->clear($this->user);
|
||||
|
||||
$json = new StdClass();
|
||||
$json->code = 200;
|
||||
|
||||
echo Zend_Json::encode($json);
|
||||
}
|
||||
}
|
58
modules/default/controllers/IdentityController.php
Normal file
58
modules/default/controllers/IdentityController.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?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 IdentityController extends Monkeys_Controller_Action
|
||||
{
|
||||
protected $_numCols = 1;
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
throw new Monkeys_BadUrlException($this->getRequest()->getRequestUri());
|
||||
}
|
||||
|
||||
public function idAction()
|
||||
{
|
||||
$currentUrl = Zend_OpenId::selfURL();
|
||||
|
||||
if ($this->_config->subdomain->enabled) {
|
||||
$protocol = $this->_getProtocol();
|
||||
preg_match('#(.*)\.'.$this->_config->subdomain->hostname.'#', $currentUrl, $matches);
|
||||
|
||||
$this->view->headLink()->headLink(array(
|
||||
'rel' => 'openid.server',
|
||||
'href' => "$protocol://"
|
||||
. ($this->_config->subdomain->use_www? 'www.' : '')
|
||||
. $this->_config->subdomain->hostname
|
||||
. '/openid/provider'
|
||||
));
|
||||
$this->view->headLink()->headLink(array(
|
||||
'rel' => 'openid2.provider',
|
||||
'href' => "$protocol://"
|
||||
. ($this->_config->subdomain->use_www? 'www.' : '')
|
||||
. $this->_config->subdomain->hostname
|
||||
. '/openid/provider'
|
||||
));
|
||||
} else {
|
||||
preg_match('#(.*)/identity/#', $currentUrl, $matches);
|
||||
|
||||
$this->view->headLink()->headLink(array(
|
||||
'rel' => 'openid.server',
|
||||
'href' => $matches[1] . '/openid/provider',
|
||||
));
|
||||
$this->view->headLink()->headLink(array(
|
||||
'rel' => 'openid2.provider',
|
||||
'href' => $matches[1] . '/openid/provider',
|
||||
));
|
||||
}
|
||||
|
||||
$this->view->idUrl = $currentUrl;
|
||||
}
|
||||
}
|
87
modules/default/controllers/IndexController.php
Normal file
87
modules/default/controllers/IndexController.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?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 IndexController extends Monkeys_Controller_Action
|
||||
{
|
||||
const NEWS_CONTENT_MAX_LENGTH = 100;
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$scriptsDir = $this->view->getScriptPaths();
|
||||
|
||||
$locale = Zend_Registry::get('Zend_Locale');
|
||||
// render() changes _ to -
|
||||
$locale = str_replace('_', '-', $locale);
|
||||
$localeElements = explode('-', $locale);
|
||||
|
||||
$view = false;
|
||||
foreach ($scriptsDir as $scriptDir) {
|
||||
if (file_exists($scriptDir."index/subheader-$locale.phtml")) {
|
||||
$view = "subheader-$locale";
|
||||
break;
|
||||
} else if (count($localeElements == 2)
|
||||
&& file_exists($scriptDir."index/subheader-".$localeElements[0].".phtml")) {
|
||||
$view = 'subheader-'.$localeElements[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$view) {
|
||||
$view = 'subheader-en';
|
||||
}
|
||||
|
||||
$this->getResponse()->insert('subHeader', $this->view->render("index/$view.phtml"));
|
||||
|
||||
$this->_helper->actionStack('index', 'login', 'users');
|
||||
|
||||
try {
|
||||
$feed = Zend_Feed::import($this->_config->news_feed->url);
|
||||
} catch (Zend_Exception $e) {
|
||||
// feed import failed
|
||||
$obj = new StdClass();
|
||||
$obj->link = array('href' => '');
|
||||
$obj->title = $this->view->translate('Could not retrieve news items');
|
||||
$obj->updated = '';
|
||||
$obj->content = '';
|
||||
$feed = array($obj);
|
||||
}
|
||||
|
||||
$this->view->news = array();
|
||||
$i = 0;
|
||||
foreach ($feed as $item) {
|
||||
if ($i++ >= $this->_config->news_feed->num_items) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (strlen($item->content) > self::NEWS_CONTENT_MAX_LENGTH) {
|
||||
$item->content = substr($item->content, 0, self::NEWS_CONTENT_MAX_LENGTH)
|
||||
. '...<br /><a class="readMore" href="'.$item->link['href'].'">' . $this->view->translate('Read More') . '</a>';
|
||||
}
|
||||
$this->view->news[] = $item;
|
||||
}
|
||||
|
||||
$view = false;
|
||||
foreach ($scriptsDir as $scriptDir) {
|
||||
if (file_exists($scriptDir."index/index-$locale.phtml")) {
|
||||
$view = "index-$locale";
|
||||
break;
|
||||
} else if (count($localeElements == 2)
|
||||
&& file_exists($scriptDir."index/index-".$localeElements[0].".phtml")) {
|
||||
$view = 'index-'.$localeElements[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$view) {
|
||||
$view = 'index-en';
|
||||
}
|
||||
|
||||
$this->render($view);
|
||||
}
|
||||
}
|
37
modules/default/controllers/LearnmoreController.php
Normal file
37
modules/default/controllers/LearnmoreController.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?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 LearnmoreController extends Monkeys_Controller_Action
|
||||
{
|
||||
protected $_numCols = 1;
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$scriptsDir = $this->view->getScriptPath('learnmore');
|
||||
|
||||
$locale = Zend_Registry::get('Zend_Locale');
|
||||
// render() changes _ to -
|
||||
$locale = str_replace('_', '-', $locale);
|
||||
$localeElements = explode('-', $locale);
|
||||
|
||||
if (file_exists("$scriptsDir/index-$locale.phtml")) {
|
||||
$view = "index-$locale";
|
||||
} else if (count($localeElements == 2)
|
||||
&& file_exists("$scriptsDir/index-".$localeElements[0].".phtml")) {
|
||||
$view = 'index-'.$localeElements[0];
|
||||
} else {
|
||||
$view = 'index-en';
|
||||
}
|
||||
|
||||
$this->render($view);
|
||||
}
|
||||
}
|
||||
|
35
modules/default/controllers/MaintenancemodeController.php
Normal file
35
modules/default/controllers/MaintenancemodeController.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?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 MaintenancemodeController extends Monkeys_Controller_Action
|
||||
{
|
||||
private $_settings;
|
||||
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
$this->_settings = new Settings();
|
||||
}
|
||||
|
||||
public function enableAction()
|
||||
{
|
||||
$this->_settings->set(Settings::MAINTENANCE_MODE, 1);
|
||||
|
||||
$this->_redirect('');
|
||||
}
|
||||
|
||||
public function disableAction()
|
||||
{
|
||||
$this->_settings->set(Settings::MAINTENANCE_MODE, 0);
|
||||
|
||||
$this->_redirect('');
|
||||
}
|
||||
}
|
130
modules/default/controllers/MessageusersController.php
Normal file
130
modules/default/controllers/MessageusersController.php
Normal file
@ -0,0 +1,130 @@
|
||||
<?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 MessageusersController extends Monkeys_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$appSession = Zend_Registry::get('appSession');
|
||||
if (isset($appSession->messageUsersForm)) {
|
||||
$this->view->messageUsersForm = $appSession->messageUsersForm;
|
||||
unset($appSession->messageUsersForm);
|
||||
} else {
|
||||
$this->view->messageUsersForm = new MessageUsersForm();
|
||||
}
|
||||
|
||||
$this->_helper->actionStack('index', 'login', 'users');
|
||||
}
|
||||
|
||||
public function sendAction()
|
||||
{
|
||||
$form = new MessageUsersForm();
|
||||
$formData = $this->_request->getPost();
|
||||
|
||||
$form->populate($formData);
|
||||
if (!$form->isValid($formData)) {
|
||||
return $this->_redirectFaultyForm($form);
|
||||
}
|
||||
|
||||
$cc = $form->getValue('cc');
|
||||
$ccArr = array();
|
||||
if (trim($cc) != '') {
|
||||
$validator = new Zend_Validate_EmailAddress();
|
||||
$ccArr = explode(',', $cc);
|
||||
for ($i = 0; $i < count($ccArr); $i++) {
|
||||
$ccArr[$i] = trim($ccArr[$i]);
|
||||
if (!$validator->isValid($ccArr[$i])) {
|
||||
foreach ($validator->getMessages() as $messageId => $message) {
|
||||
$form->cc->addError($this->view->translate('CC field must be a comma-separated list of valid E-mails'));
|
||||
return $this->_redirectFaultyForm($form);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$mail = self::getMail(
|
||||
$form->getValue('subject'),
|
||||
$this->_getParam('messageType'),
|
||||
$this->_getParam('messageType') == 'plain'?
|
||||
$form->getValue('bodyPlain')
|
||||
: $form->getValue('bodyHTML')
|
||||
);
|
||||
|
||||
$mail->setSubject($form->getValue('subject'));
|
||||
if ($this->_getParam('messageType') == 'plain') {
|
||||
$mail->setBodyText($form->getValue('bodyPlain'));
|
||||
} else {
|
||||
$mail->setBodyHtml($form->getValue('bodyHTML'));
|
||||
}
|
||||
|
||||
$users = new Users();
|
||||
foreach ($users->getUsers() as $user) {
|
||||
$mail->addTo($user->email);
|
||||
}
|
||||
|
||||
foreach ($ccArr as $cc) {
|
||||
$mail->addCC($cc);
|
||||
}
|
||||
|
||||
try {
|
||||
$mail->send();
|
||||
$this->_helper->FlashMessenger->addMessage('Message has been sent');
|
||||
} catch (Zend_Mail_Protocol_Exception $e) {
|
||||
$this->_helper->FlashMessenger->addMessage('There was an error trying to send the message');
|
||||
if ($this->_config->logging->level == Zend_Log::DEBUG) {
|
||||
$this->_helper->FlashMessenger->addMessage($e->getMessage());
|
||||
|
||||
return $this->_redirectFaultyForm($form);
|
||||
}
|
||||
}
|
||||
|
||||
$this->_redirect('');
|
||||
}
|
||||
|
||||
private function _redirectFaultyForm(Zend_Form $form)
|
||||
{
|
||||
$appSession = Zend_Registry::get('appSession');
|
||||
$appSession->messageUsersForm = $form;
|
||||
|
||||
return $this->_forward('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Zend_Mail
|
||||
* @throws Zend_Mail_Protocol_Exception
|
||||
*/
|
||||
public static function getMail()
|
||||
{
|
||||
// can't use $this->_config 'cause we're in 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('UTF-8');
|
||||
$mail->setFrom('support@community-id.org');
|
||||
|
||||
return $mail;
|
||||
}
|
||||
}
|
||||
|
178
modules/default/controllers/OpenidController.php
Normal file
178
modules/default/controllers/OpenidController.php
Normal file
@ -0,0 +1,178 @@
|
||||
<?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 OpenidController extends Monkeys_Controller_Action
|
||||
{
|
||||
public function providerAction()
|
||||
{
|
||||
if (isset($_POST['action']) && $_POST['action'] == 'proceed') {
|
||||
return $this->_proceed();
|
||||
} else {
|
||||
Zend_OpenId::$exitOnRedirect = false;
|
||||
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$server = $this->_getOpenIdProvider();
|
||||
$response = new Zend_Controller_Response_Http();
|
||||
$ret = $server->handle(null, new Zend_OpenId_Extension_Sreg(), $response);
|
||||
Zend_Registry::get('logger')->log("RET: ".print_r($ret, true), Zend_Log::DEBUG);
|
||||
Zend_Registry::get('logger')->log("RESPONSE: ".print_r($response->getHeaders(), true), Zend_Log::DEBUG);
|
||||
if (is_string($ret)) {
|
||||
echo $ret;
|
||||
} else if ($ret !== true) {
|
||||
header('HTTP/1.0 403 Forbidden');
|
||||
Zend_Registry::get('logger')->log("OpenIdController::providerAction: FORBIDDEN", Zend_Log::DEBUG);
|
||||
echo 'Forbidden';
|
||||
} elseif ($ret === true
|
||||
// Zend_OpenId is messy and can change the type of the response I initially sent >:|
|
||||
&& is_a($response, 'Zend_Controller_Response_Http'))
|
||||
|
||||
{
|
||||
$headers = $response->getHeaders();
|
||||
if (isset($headers[0]['name']) && $headers[0]['name'] == 'Location'
|
||||
// redirection to the Trust page is not logged
|
||||
&& strpos($headers[0]['value'], '/openid/trust') === false
|
||||
&& strpos($headers[0]['value'], '/openid/login') === false)
|
||||
{
|
||||
if (strpos($headers[0]['value'], 'openid.mode=cancel') !== false) {
|
||||
$this->_saveHistory($server, History::DENIED);
|
||||
} else {
|
||||
$this->_saveHistory($server, History::AUTHORIZED);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function loginAction()
|
||||
{
|
||||
$appSession = Zend_Registry::get('appSession');
|
||||
if (isset($appSession->openidLoginForm)) {
|
||||
$this->view->form = $appSession->openidLoginForm;
|
||||
unset($appSession->openidLoginForm);
|
||||
} else {
|
||||
$this->view->form = new OpenidLoginForm();
|
||||
}
|
||||
$this->view->form->openIdIdentity->setValue(htmlspecialchars($_GET['openid_identity']));
|
||||
|
||||
$this->view->queryString = $_SERVER['QUERY_STRING'];
|
||||
}
|
||||
|
||||
public function authenticateAction()
|
||||
{
|
||||
$form = new OpenidLoginForm();
|
||||
$formData = $this->_request->getPost();
|
||||
$form->populate($formData);
|
||||
|
||||
if (!$form->isValid($formData)) {
|
||||
$appSession = Zend_Registry::get('appSession');
|
||||
$appSession->openidLoginForm = $form;
|
||||
return $this->_forward('login', null, null);
|
||||
}
|
||||
|
||||
$server = $this->_getOpenIdProvider();
|
||||
$server->login($form->getValue('openIdIdentity'), $form->getValue('password'));
|
||||
|
||||
// needed for unit tests
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
Zend_OpenId::redirect($this->view->base . '/openid/provider', $_GET);
|
||||
}
|
||||
|
||||
public function trustAction()
|
||||
{
|
||||
$server = $this->_getOpenIdProvider();
|
||||
$this->view->siteRoot = $server->getSiteRoot($_GET);
|
||||
$this->view->identityUrl = $server->getLoggedInUser($_GET);
|
||||
$this->view->queryString = $_SERVER['QUERY_STRING'];
|
||||
|
||||
$sreg = new Zend_OpenId_Extension_Sreg();
|
||||
$sreg->parseRequest($_GET);
|
||||
|
||||
$this->view->fields = array();
|
||||
$this->view->policyUrl = false;
|
||||
|
||||
$props = $sreg->getProperties();
|
||||
if (is_array($props) && count($props) > 0) {
|
||||
$personalInfoForm = new PersonalInfoForm(null, $this->user, $props);
|
||||
$this->view->fields = $personalInfoForm->getElements();
|
||||
|
||||
$policy = $sreg->getPolicyUrl();
|
||||
if (!empty($policy)) {
|
||||
$this->view->policyUrl = $policy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function _proceed()
|
||||
{
|
||||
// needed for unit tests
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$server = $this->_getOpenIdProvider();
|
||||
|
||||
$sreg = new Zend_OpenId_Extension_Sreg();
|
||||
$sreg->parseRequest($_GET);
|
||||
$props = $sreg->getProperties();
|
||||
|
||||
$personalInfoForm = new PersonalInfoForm(null, $this->user, $props);
|
||||
$formData = $this->_request->getPost();
|
||||
$personalInfoForm->populate($formData);
|
||||
|
||||
// not planning on validating stuff here yet, but I call this
|
||||
// for the date element to be filled properly
|
||||
$personalInfoForm->isValid($formData);
|
||||
|
||||
$sreg->parseResponse($personalInfoForm->getValues());
|
||||
if (isset($_POST['allow'])) {
|
||||
if (isset($_POST['forever'])) {
|
||||
$server->allowSite($server->getSiteRoot($_GET), $sreg);
|
||||
}
|
||||
unset($_GET['openid_action']);
|
||||
|
||||
$this->_saveHistory($server, History::AUTHORIZED);
|
||||
|
||||
$server->respondToConsumer($_GET, $sreg);
|
||||
} else if (isset($_POST['deny'])) {
|
||||
if (isset($_POST['forever'])) {
|
||||
$server->denySite($server->getSiteRoot($_GET));
|
||||
}
|
||||
|
||||
$this->_saveHistory($server, History::DENIED);
|
||||
|
||||
Zend_OpenId::redirect($_GET['openid_return_to'], array('openid.mode'=>'cancel'));
|
||||
}
|
||||
}
|
||||
private function _saveHistory(Zend_OpenId_Provider $server, $result)
|
||||
{
|
||||
$histories = new Histories();
|
||||
$history = $histories->createRow();
|
||||
$history->user_id = $this->user->id;
|
||||
$history->date = date('Y-m-d H:i:s');
|
||||
$history->site = $server->getSiteRoot($_GET);
|
||||
$history->ip = $_SERVER['REMOTE_ADDR'];
|
||||
$history->result = $result;
|
||||
$history->save();
|
||||
}
|
||||
|
||||
private function _getOpenIdProvider()
|
||||
{
|
||||
$server = new Zend_OpenId_Provider($this->view->base . '/openid/login',
|
||||
$this->view->base . '/openid/trust',
|
||||
new OpenIdUser(),
|
||||
new Monkeys_OpenId_Provider_Storage_Database());
|
||||
|
||||
return $server;
|
||||
}
|
||||
}
|
32
modules/default/controllers/PrivacyController.php
Normal file
32
modules/default/controllers/PrivacyController.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?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 PrivacyController extends Monkeys_Controller_Action
|
||||
{
|
||||
protected $_numCols = 1;
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$locale = Zend_Registry::get('Zend_Locale');
|
||||
$localeElements = explode('_', $locale);
|
||||
|
||||
if (file_exists(APP_DIR . "/resources/$locale/privacy.txt")) {
|
||||
$file = APP_DIR . "/resources/$locale/privacy.txt";
|
||||
} else if (count($localeElements == 2)
|
||||
&& file_exists(APP_DIR . "/resources/".$localeElements[0]."/privacy.txt")) {
|
||||
$file = APP_DIR . "/resources/".$localeElements[0]."/privacy.txt";
|
||||
} else {
|
||||
$file = APP_DIR . "/resources/en/privacy.txt";
|
||||
}
|
||||
|
||||
$this->view->privacyPolicy = nl2br(file_get_contents($file));
|
||||
}
|
||||
}
|
121
modules/default/controllers/SitesController.php
Normal file
121
modules/default/controllers/SitesController.php
Normal file
@ -0,0 +1,121 @@
|
||||
<?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 SitesController extends Monkeys_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->actionStack('index', 'login', 'users');
|
||||
}
|
||||
|
||||
public function listAction()
|
||||
{
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$fields = new Fields();
|
||||
$sites = new Sites();
|
||||
$sitesRows = $sites->get(
|
||||
$this->user,
|
||||
$this->_getParam('startIndex'),
|
||||
$this->_getParam('results')
|
||||
);
|
||||
|
||||
$jsonObj = new StdClass();
|
||||
$jsonObj->recordsReturned = count($sitesRows);
|
||||
$jsonObj->totalRecords = $sites->getNumSites($this->user);
|
||||
$jsonObj->startIndex = $this->_getParam('startIndex');
|
||||
$jsonObj->sort = null;
|
||||
$jsonObj->dir = 'asc';
|
||||
$jsonObj->records = array();
|
||||
|
||||
foreach ($sitesRows as $site) {
|
||||
$jsonObjSite = new StdClass();
|
||||
$jsonObjSite->id = $site->id;
|
||||
$jsonObjSite->site = $site->site;
|
||||
|
||||
$trusted = unserialize($site->trusted);
|
||||
$jsonObjSite->trusted = (is_bool($trusted) && $trusted) || is_array($trusted);
|
||||
|
||||
if (is_array($trusted)
|
||||
&& isset($trusted['Zend_OpenId_Extension_Sreg'])
|
||||
&& count($trusted['Zend_OpenId_Extension_Sreg']) > 0)
|
||||
{
|
||||
$translatedTrusted = array();
|
||||
foreach ($trusted['Zend_OpenId_Extension_Sreg'] as $identifier => $value) {
|
||||
$translatedTrusted[$this->view->translate($fields->getFieldName($identifier))] = $value;
|
||||
}
|
||||
$jsonObjSite->infoExchanged = $translatedTrusted;
|
||||
} else {
|
||||
$jsonObjSite->infoExchanged = false;
|
||||
}
|
||||
|
||||
$jsonObj->records[] = $jsonObjSite;
|
||||
}
|
||||
|
||||
echo Zend_Json::encode($jsonObj);
|
||||
}
|
||||
|
||||
public function denyAction()
|
||||
{
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$sites = new Sites();
|
||||
$site = $sites->getRowInstance($this->_getParam('id'));
|
||||
if ($site->user_id != $this->user->id) {
|
||||
throw new Monkeys_AccessDeniedException();
|
||||
}
|
||||
|
||||
$site->trusted = serialize(false);
|
||||
$site->save();
|
||||
|
||||
$json = new StdClass();
|
||||
$json->code = 200;
|
||||
|
||||
echo Zend_Json::encode($json);
|
||||
}
|
||||
|
||||
public function allowAction()
|
||||
{
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$sites = new Sites();
|
||||
$site = $sites->getRowInstance($this->_getParam('id'));
|
||||
if ($site->user_id != $this->user->id) {
|
||||
throw new Monkeys_AccessDeniedException();
|
||||
}
|
||||
|
||||
$site->trusted = serialize(true);
|
||||
$site->save();
|
||||
|
||||
$json = new StdClass();
|
||||
$json->code = 200;
|
||||
|
||||
echo Zend_Json::encode($json);
|
||||
}
|
||||
|
||||
public function deleteAction()
|
||||
{
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$sites = new Sites();
|
||||
$site = $sites->getRowInstance($this->_getParam('id'));
|
||||
if ($site->user_id != $this->user->id) {
|
||||
throw new Monkeys_AccessDeniedException();
|
||||
}
|
||||
|
||||
$site->delete();
|
||||
|
||||
$json = new StdClass();
|
||||
$json->code = 200;
|
||||
|
||||
echo Zend_Json::encode($json);
|
||||
}
|
||||
}
|
25
modules/default/forms/ErrorMessages.php
Normal file
25
modules/default/forms/ErrorMessages.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
|
||||
* @license http://creativecommons.org/licenses/BSD/ BSD License
|
||||
* @author Keyboard Monkeys Ltd.
|
||||
* @since Textroller 0.9
|
||||
* @package TextRoller
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class is never called. It's only a placeholder for form error messages wrapped in translate(),
|
||||
* so that Poedit (or any other message catalogs editor) can catalog these messages for translation
|
||||
*/
|
||||
class ErrorMessages
|
||||
{
|
||||
private function _messages()
|
||||
{
|
||||
translate('Value is empty, but a non-empty value is required');
|
||||
translate('\'%value%\' is not a valid email address in the basic format local-part@hostname');
|
||||
translate('Captcha value is wrong');
|
||||
translate('Password confirmation does not match');
|
||||
}
|
||||
}
|
61
modules/default/forms/FeedbackForm.php
Normal file
61
modules/default/forms/FeedbackForm.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?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 FeedbackForm extends Zend_Form
|
||||
{
|
||||
private $_baseWebDir;
|
||||
|
||||
public function __construct($options = null, $baseWebDir = null)
|
||||
{
|
||||
$this->_baseWebDir = $baseWebDir;
|
||||
parent::__construct($options);
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
$name = new Monkeys_Form_Element_Text('name');
|
||||
translate('Enter your name');
|
||||
$name->setLabel('Enter your name')
|
||||
->setRequired(true);
|
||||
|
||||
$email = new Monkeys_Form_Element_Text('email');
|
||||
translate('Enter your E-mail');
|
||||
$email->setLabel('Enter your E-mail')
|
||||
->addFilter('StringToLower')
|
||||
->setRequired(true)
|
||||
->addValidator('EmailAddress');
|
||||
|
||||
$feedback = new Monkeys_Form_Element_Textarea('feedback');
|
||||
translate('Enter your questions or comments');
|
||||
$feedback->setLabel('Enter your questions or comments')
|
||||
->setRequired(true)
|
||||
->setAttrib('cols', 60)
|
||||
->setAttrib('rows', 4);
|
||||
|
||||
// ZF has some bugs when using mutators here, so I have to use the config array
|
||||
translate('Please enter the text below');
|
||||
$captcha = new Monkeys_Form_Element_Captcha('captcha', array(
|
||||
'label' => 'Please enter the text below',
|
||||
'captcha' => array(
|
||||
'captcha' => 'Image',
|
||||
'sessionClass' => get_class(Zend_Registry::get('appSession')),
|
||||
'font' => APP_DIR . '/libs/Monkeys/fonts/Verdana.ttf',
|
||||
'imgDir' => APP_DIR . '/webdir/captchas',
|
||||
'imgUrl' => $this->_baseWebDir . '/captchas',
|
||||
'wordLen' => 4,
|
||||
'fontSize' => 30,
|
||||
'timeout' => 300,
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElements(array($name, $email, $feedback, $captcha));
|
||||
}
|
||||
}
|
34
modules/default/forms/MessageUsersForm.php
Normal file
34
modules/default/forms/MessageUsersForm.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?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 MessageUsersForm extends Zend_Form
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$subject = new Zend_Form_Element_Text('subject');
|
||||
translate('Subject:');
|
||||
$subject->setLabel('Subject:')
|
||||
->setRequired(true);
|
||||
|
||||
$cc = new Zend_Form_Element_Text('cc');
|
||||
translate('CC:');
|
||||
$cc->setLabel('CC:');
|
||||
|
||||
$bodyPlain = new Zend_Form_Element_Textarea('bodyPlain');
|
||||
translate('Body:');
|
||||
$bodyPlain->setLabel('Body:');
|
||||
|
||||
$bodyHTML = new Zend_Form_Element_Textarea('bodyHTML');
|
||||
$bodyHTML->setLabel('Body:');
|
||||
|
||||
$this->addElements(array($subject, $cc, $bodyPlain, $bodyHTML));
|
||||
}
|
||||
}
|
28
modules/default/forms/OpenidLoginForm.php
Normal file
28
modules/default/forms/OpenidLoginForm.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?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 OpenIdLoginForm extends Zend_Form
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$openIdIdentity = new Zend_Form_Element_Text('openIdIdentity');
|
||||
translate('Username');
|
||||
$openIdIdentity->setLabel('Username')
|
||||
->setRequired(true);
|
||||
|
||||
$password = new Zend_Form_Element_Password('password');
|
||||
translate('Password');
|
||||
$password->setLabel('Password')
|
||||
->setRequired(true);
|
||||
|
||||
$this->addElements(array($openIdIdentity, $password));
|
||||
}
|
||||
}
|
15
modules/default/models/Association.php
Normal file
15
modules/default/models/Association.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?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 Association extends Zend_Db_Table_Row_Abstract
|
||||
{
|
||||
}
|
26
modules/default/models/Associations.php
Normal file
26
modules/default/models/Associations.php
Normal 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 Associations extends Monkeys_Db_Table_Gateway
|
||||
{
|
||||
protected $_name = 'associations';
|
||||
protected $_primary = 'handle';
|
||||
protected $_rowClass = 'Association';
|
||||
|
||||
public function getAssociationGivenHandle($handle)
|
||||
{
|
||||
$select = $this->select()
|
||||
->where('handle=?', $handle);
|
||||
|
||||
return $this->fetchRow($select);
|
||||
}
|
||||
}
|
68
modules/default/models/Field.php
Normal file
68
modules/default/models/Field.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?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 Field extends Zend_Db_Table_Row_Abstract
|
||||
{
|
||||
const TYPE_TEXT = 1;
|
||||
const TYPE_DATE = 2;
|
||||
const TYPE_GENDER = 3;
|
||||
const TYPE_COUNTRY = 4;
|
||||
const TYPE_LANGUAGE = 5;
|
||||
const TYPE_TIMEZONE = 6;
|
||||
const TYPE_EMAIL = 7;
|
||||
|
||||
public function getFormElement()
|
||||
{
|
||||
$varname = 'field_' . $this->id;
|
||||
|
||||
switch ($this->type) {
|
||||
case self::TYPE_TEXT:
|
||||
$el = new Monkeys_Form_Element_Text($varname);
|
||||
break;
|
||||
case self::TYPE_DATE:
|
||||
$el = new Monkeys_Form_Element_Date($varname);
|
||||
$el->addValidator('date')
|
||||
->setShowEmptyValues(true)
|
||||
->setStartEndYear(1900, date('Y') - 7)
|
||||
->setReverseYears(true);
|
||||
break;
|
||||
case self::TYPE_GENDER:
|
||||
translate('Male');
|
||||
translate('Female');
|
||||
$el = new Monkeys_Form_Element_Radio($varname);
|
||||
$el->setSeparator('  ')
|
||||
->addMultiOption('M', 'Male')
|
||||
->addMultiOption('F', 'Female');
|
||||
break;
|
||||
case self::TYPE_COUNTRY:
|
||||
$el = new Monkeys_Form_Element_Country($varname);
|
||||
break;
|
||||
case self::TYPE_LANGUAGE:
|
||||
$el = new Monkeys_Form_Element_Language($varname);
|
||||
break;
|
||||
case self::TYPE_TIMEZONE:
|
||||
$el = new Monkeys_Form_Element_Timezone($varname);
|
||||
break;
|
||||
case self::TYPE_EMAIL:
|
||||
$el = new Monkeys_Form_Element_Text($varname);
|
||||
$el->addValidator('EmailAddress');
|
||||
break;
|
||||
default:
|
||||
throw new Exception('Unknown field type: ' . $this->type);
|
||||
break;
|
||||
}
|
||||
$el->setLabel($this->name);
|
||||
$el->setValue($this->value);
|
||||
|
||||
return $el;
|
||||
}
|
||||
}
|
55
modules/default/models/Fields.php
Normal file
55
modules/default/models/Fields.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?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 Fields extends Monkeys_Db_Table_Gateway
|
||||
{
|
||||
protected $_name = 'fields';
|
||||
protected $_primary = 'id';
|
||||
protected $_rowClass = 'Field';
|
||||
|
||||
private $_fieldsNames= array();
|
||||
|
||||
public function getValues(User $user)
|
||||
{
|
||||
$userId = (int)$user->id;
|
||||
$select = $this->select()
|
||||
->setIntegrityCheck(false)
|
||||
->from('fields')
|
||||
->joinLeft('fields_values', "fields_values.field_id=fields.id AND fields_values.user_id=".$user->id);
|
||||
|
||||
return $this->fetchAll($select);
|
||||
}
|
||||
|
||||
public function getFieldName($fieldIdentifier)
|
||||
{
|
||||
if (!$this->_fieldsNames) {
|
||||
foreach ($this->fetchAll($this->select()) as $field) {
|
||||
$this->_fieldsNames[$field->openid] = $field->name;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_fieldsNames[$fieldIdentifier];
|
||||
}
|
||||
|
||||
private function _translationPlaceholders()
|
||||
{
|
||||
translate('Nickname');
|
||||
translate('E-mail');
|
||||
translate('Full Name');
|
||||
translate('Date of Birth');
|
||||
translate('Gender');
|
||||
translate('Postal Code');
|
||||
translate('Country');
|
||||
translate('Language');
|
||||
translate('Time Zone');
|
||||
}
|
||||
}
|
15
modules/default/models/FieldsValue.php
Normal file
15
modules/default/models/FieldsValue.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?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 FieldsValue extends Zend_Db_Table_Row_Abstract
|
||||
{
|
||||
}
|
24
modules/default/models/FieldsValues.php
Normal file
24
modules/default/models/FieldsValues.php
Normal 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 FieldsValues extends Monkeys_Db_Table_Gateway
|
||||
{
|
||||
protected $_name = 'fields_values';
|
||||
protected $_primary = array('user_id', 'field_id');
|
||||
protected $_rowClass = 'FieldsValue';
|
||||
|
||||
public function deleteForUser(User $user)
|
||||
{
|
||||
$where = $this->getAdapter()->quoteInto('user_id=?', $user->id);
|
||||
$this->delete($where);
|
||||
}
|
||||
}
|
51
modules/default/models/Histories.php
Executable file
51
modules/default/models/Histories.php
Executable file
@ -0,0 +1,51 @@
|
||||
<?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 Histories extends Monkeys_Db_Table_Gateway
|
||||
{
|
||||
protected $_name = 'history';
|
||||
protected $_primary = 'id';
|
||||
protected $_rowClass = 'History';
|
||||
|
||||
public function get(User $user, $startIndex, $results)
|
||||
{
|
||||
$select = $this->select()
|
||||
->where('user_id=?', $user->id);
|
||||
|
||||
if ($startIndex !== false && $results !== false) {
|
||||
$select = $select->limit($results, $startIndex);
|
||||
}
|
||||
|
||||
return $this->fetchAll($select);
|
||||
}
|
||||
|
||||
public function getNumHistories(User $user)
|
||||
{
|
||||
$sites = $this->get($user, false, false);
|
||||
|
||||
return count($sites);
|
||||
}
|
||||
|
||||
public function clear(User $user)
|
||||
{
|
||||
$where = $this->getAdapter()->quoteInto('user_id=?', $user->id);
|
||||
$this->delete($where);
|
||||
}
|
||||
|
||||
public function clearOldEntries()
|
||||
{
|
||||
$days = Zend_Registry::get('config')->environment->keep_history_days;
|
||||
|
||||
$where = $this->getAdapter()->quoteInto('date < ?', date('Y-m-d', time() - $days * 86400));
|
||||
$this->delete($where);
|
||||
}
|
||||
}
|
17
modules/default/models/History.php
Executable file
17
modules/default/models/History.php
Executable file
@ -0,0 +1,17 @@
|
||||
<?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 History extends Zend_Db_Table_Row_Abstract
|
||||
{
|
||||
const DENIED = 0;
|
||||
const AUTHORIZED = 1;
|
||||
}
|
38
modules/default/models/Settings.php
Normal file
38
modules/default/models/Settings.php
Normal 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 Settings extends Monkeys_Db_Table_Gateway
|
||||
{
|
||||
protected $_name = 'settings';
|
||||
protected $_primary = 'name';
|
||||
|
||||
const MAINTENANCE_MODE = 'maintenance_mode';
|
||||
|
||||
public function get($name)
|
||||
{
|
||||
$select = $this->select()
|
||||
->where('name=?', $name);
|
||||
|
||||
$row = $this->fetchRow($select);
|
||||
|
||||
return $row->value;
|
||||
}
|
||||
|
||||
public function set($name, $value)
|
||||
{
|
||||
$this->update(array('value' => $value), $this->getAdapter()->quoteInto('name=?', $name));
|
||||
}
|
||||
|
||||
public function isMaintenanceMode()
|
||||
{
|
||||
return $this->get(self::MAINTENANCE_MODE);
|
||||
}
|
||||
}
|
15
modules/default/models/Site.php
Normal file
15
modules/default/models/Site.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?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 Site extends Zend_Db_Table_Row_Abstract
|
||||
{
|
||||
}
|
52
modules/default/models/Sites.php
Normal file
52
modules/default/models/Sites.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?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 Sites extends Monkeys_Db_Table_Gateway
|
||||
{
|
||||
protected $_name = 'sites';
|
||||
protected $_primary = 'id';
|
||||
protected $_rowClass = 'Site';
|
||||
|
||||
public function deleteForUserSite(User $user, $site)
|
||||
{
|
||||
$where1 = $this->getAdapter()->quoteInto('user_id=?',$user->id);
|
||||
$where2 = $this->getAdapter()->quoteInto('site=?', $site);
|
||||
$this->delete("$where1 AND $where2");
|
||||
}
|
||||
|
||||
public function get(User $user, $startIndex, $results)
|
||||
{
|
||||
$select = $this->select()
|
||||
->where('user_id=?', $user->id);
|
||||
|
||||
if ($startIndex !== false && $results !== false) {
|
||||
$select = $select->limit($results, $startIndex);
|
||||
}
|
||||
|
||||
return $this->fetchAll($select);
|
||||
}
|
||||
|
||||
public function getNumSites(User $user)
|
||||
{
|
||||
$sites = $this->get($user, false, false);
|
||||
|
||||
return count($sites);
|
||||
}
|
||||
|
||||
public function getTrusted(User $user)
|
||||
{
|
||||
$select = $this->select()
|
||||
->where('user_id=?', $user->id);
|
||||
|
||||
return $this->fetchAll($select);
|
||||
}
|
||||
}
|
22
modules/default/views/scripts/about/index-de.phtml
Normal file
22
modules/default/views/scripts/about/index-de.phtml
Normal file
@ -0,0 +1,22 @@
|
||||
<p>
|
||||
Community-ID ist ein Service, zur Verfügung gestellt mit freundlicher Unterstützung von Keyboard Monkeys Ltd., Community as a Service ™.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Keyboard Monkeys Ltd. konzentriert sich auf Open-Source-Lösungen und Produkte zur Bildung von Communities über das Internet. Wie bieten auch Consulting so wie ein breites Spektrum an Unterstützung für Open-Source-Technologien aber speziell bieten wir Community-basierte Lösungen und Produkte.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Weitere Produkte oder Services welche wir zur Zeit anbieten oder welche sich in der Planung befinden:
|
||||
<ul>
|
||||
<li>
|
||||
<b><a href="http://sourceforge.net/projects/sciret">Sciret</a></b> - Enterprise Knowledge Base System
|
||||
</li>
|
||||
<li>
|
||||
<b><a href="http://sourceforge.net/projects/textroller">TextRoller</a></b> - Blogging Platform
|
||||
</li>
|
||||
<li>
|
||||
<b>Community Solutions</b> - Open Source Project Collaboration (Zur Zeit unter interner Entwicklung)
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
22
modules/default/views/scripts/about/index-en.phtml
Normal file
22
modules/default/views/scripts/about/index-en.phtml
Normal file
@ -0,0 +1,22 @@
|
||||
<p>
|
||||
Community-ID is a service brought to you by Keyboard Monkeys Ltd., Community as a Service ™.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Keyboard Monkeys Ltd. focuses on providing open source solutions and products aimed at empowering communities accross the Internet. We also do private consulting, providing a wide range of support for open source technologies, but specially we are offering community based solutions and products.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
These are other services and products currently offered, or under planning:
|
||||
<ul>
|
||||
<li>
|
||||
<b><a href="http://sourceforge.net/projects/sciret">Sciret</a></b> - Enterprise Knowledge Base System
|
||||
</li>
|
||||
<li>
|
||||
<b><a href="http://sourceforge.net/projects/textroller">TextRoller</a></b> - Blogging platform
|
||||
</li>
|
||||
<li>
|
||||
<b>Community Solutions</b> - Open Source Project Collaboration (Currently under initial development stages)
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
22
modules/default/views/scripts/about/index-es.phtml
Normal file
22
modules/default/views/scripts/about/index-es.phtml
Normal file
@ -0,0 +1,22 @@
|
||||
<p>
|
||||
Community-ID es un servicio traído a ustedes por Keyboard Monkeys Ltd., Community as a Service ™.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Keyboard Monkeys Ltd. está enfocada en proveer productos y soluciones Open Source dirijidas a la potenciación de comunidades a través de Internet. También hacemos consultoría privada, proporcionando un amplio rango de soporte a tecnologías Open Source, pero especialmente ofreciendo productos y soluciones basados en comunidades.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Estos son otros productos y servicio actualmente ofrecidos, o en desarrollo:
|
||||
<ul>
|
||||
<li>
|
||||
<b><a href="http://sourceforge.net/projects/sciret">Sciret</a></b> - Sistema Empresarial de Base de Conocimientos
|
||||
</li>
|
||||
<li>
|
||||
<b><a href="http://sourceforge.net/projects/textroller">TextRoller</a></b> - Plataforma de Blogging
|
||||
</li>
|
||||
<li>
|
||||
<b>Community Solutions</b> - Open Source Project Collaboration (actualmente bajo desarrollo)
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
22
modules/default/views/scripts/about/index.phtml
Normal file
22
modules/default/views/scripts/about/index.phtml
Normal file
@ -0,0 +1,22 @@
|
||||
<p>
|
||||
Community-ID is a service brought to you by Keyboard Monkeys Ltd., Community as a Service ™.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Keyboard Monkeys Ltd. focuses on providing open source solutions and products aimed at empowering communities accross the Internet. We also do private consulting, providing a wide range of support for open source technologies, but specially we are offering community based solutions and products.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
These are other services and products currently offered, or under planning:
|
||||
<ul>
|
||||
<li>
|
||||
<b><a href="http://sourceforge.net/projects/sciret">Sciret</a></b> - Enterprise Knowledge Base System
|
||||
</li>
|
||||
<li>
|
||||
<b><a href="http://sourceforge.net/projects/textroller">TextRoller</a></b> - Blogging platform
|
||||
</li>
|
||||
<li>
|
||||
<b>Community Solutions</b> - Open Source Project Collaboration (Currently under initial development stages)
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
18
modules/default/views/scripts/error/error.phtml
Executable file
18
modules/default/views/scripts/error/error.phtml
Executable file
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Error</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>An error occurred</h2>
|
||||
<strong><?= $this->message ?></strong>
|
||||
<? if ($this->trace): ?>
|
||||
<pre>
|
||||
Stack Trace:
|
||||
<?= $this->trace ?>
|
||||
</pre>
|
||||
<? endif ?>
|
||||
</body>
|
||||
</html>
|
||||
|
11
modules/default/views/scripts/feedback/index.phtml
Normal file
11
modules/default/views/scripts/feedback/index.phtml
Normal file
@ -0,0 +1,11 @@
|
||||
<h3><?= $this->translate('In order to serve you better, we have provided the form below for your questions and comments') ?></h3>
|
||||
<form id="feedbackForm" method="post" action="<?= $this->base ?>/feedback/send" class="formGrid">
|
||||
<?= $this->form->name ?>
|
||||
<?= $this->form->email ?>
|
||||
<?= $this->form->feedback ?>
|
||||
<?= $this->form->captcha ?>
|
||||
<input type="submit" id="send" value="<?= $this->translate('Send') ?>" />
|
||||
<script type="text/javascript">
|
||||
var oButton = new YAHOO.widget.Button("send");
|
||||
</script>
|
||||
</form>
|
25
modules/default/views/scripts/history/index.phtml
Executable file
25
modules/default/views/scripts/history/index.phtml
Executable file
@ -0,0 +1,25 @@
|
||||
<script>
|
||||
YAHOO.util.Event.onDOMReady(function () {
|
||||
COMMID.loader.insert(
|
||||
["datasource", "datatable", "paginator", "json", "connection", "dragdrop", "animation", "container"],
|
||||
COMMID.historyList.init,
|
||||
COMMID.historyList
|
||||
);
|
||||
});
|
||||
</script>
|
||||
<div id="paging"></div>
|
||||
<div id="dt"></div>
|
||||
<div id="clearHistory">
|
||||
<input type="button" id="clearHistoryBtn" value="<?= $this->translate('Clear History') ?>" onclick="COMMID.historyList.clearEntries()" />
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.onDOMReady(function () {
|
||||
var oButton = new YAHOO.widget.Button(
|
||||
"clearHistoryBtn",
|
||||
{
|
||||
type : "push",
|
||||
onclick : {fn: COMMID.historyList.clearEntries, scope: COMMID.historyList}
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</div>
|
4
modules/default/views/scripts/identity/id.phtml
Normal file
4
modules/default/views/scripts/identity/id.phtml
Normal file
@ -0,0 +1,4 @@
|
||||
<div id="article">
|
||||
This is the identity page for the Community-ID user identified with:
|
||||
<h2 style="text-align:center"><?= $this->idUrl ?></h2>
|
||||
</div>
|
40
modules/default/views/scripts/index/index-de.phtml
Normal file
40
modules/default/views/scripts/index/index-de.phtml
Normal file
@ -0,0 +1,40 @@
|
||||
<div id="home">
|
||||
<h2>
|
||||
Community ID: Freie OpenID Authentifizierung<br />
|
||||
100% basierend auf Open Source Technologie
|
||||
</h2>
|
||||
<div class="yui-g">
|
||||
<div class="yui-u first">
|
||||
<p>
|
||||
Von beginn an wurde Community-ID entwickelt mit Sicherheit als wichtigem Ziel. Jede Komponente in unserem Technologie-Stack wurde ausgewählt nachdem die Sicherheits Historie begutachtet wurde und am wichtigsten, alles was verwendet wurde ist Open Source.
|
||||
</p>
|
||||
<p>
|
||||
Das heißt, die ganze Welt kann sehen was wir machen. Es ist eine erwiesene Tatsache das Sicherheit durch Verschleiern nicht funktioniert und wenn Sie ein Produkt auswählen wo der darunterliegende Mechanismus als Geheimnis behandelt wird setzen Sie ihre Daten (und hiermit sich selbst) einer großen Gefahr aus.
|
||||
</p>
|
||||
<p style="font-weight: bold; text-align:center">
|
||||
Auf was warten Sie noch?<br />
|
||||
Vereinfachen Sie Ihr Leben und verringern das Risiko.<br /><br />
|
||||
<a href="<?= $this->base ?>/users/register">ERÖFFNEN SIE JETZT EIN KONTO</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="yui-u">
|
||||
<div id="homeNews">
|
||||
<h3>Letzte News</h3>
|
||||
<ul>
|
||||
<? foreach ($this->news as $item): ?>
|
||||
<li>
|
||||
<div>
|
||||
<a href="<?= $item->link['href'] ?>"><?= $item->title ?></a>
|
||||
</div>
|
||||
<div class="newsExcerpt">
|
||||
<?= $item->content ?>
|
||||
</div>
|
||||
</li>
|
||||
<? endforeach ?>
|
||||
</ul> <!-- FF bug -->
|
||||
</div>
|
||||
<div class="borderFadingLeft">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
40
modules/default/views/scripts/index/index-en.phtml
Normal file
40
modules/default/views/scripts/index/index-en.phtml
Normal file
@ -0,0 +1,40 @@
|
||||
<div id="home">
|
||||
<h2>
|
||||
Community ID: Free OpenID Authentication<br />
|
||||
Backed 100% with Open Source Technologies
|
||||
</h2>
|
||||
<div class="yui-g">
|
||||
<div class="yui-u first">
|
||||
<p>
|
||||
Since its inception Community-ID has been built with security as the foremost concern. Every element in our technology stack has been chosen looking at its security record, and most importantly, everything is Open Source.
|
||||
</p>
|
||||
<p>
|
||||
This means we're open to scrutiny by the entire world. It is already a proven fact that security by obscurity doesn't work, and when you use a product or service whose underlying mechanism is kept as a secret, you're putting your data (and therefore yourself) into great risk.
|
||||
</p>
|
||||
<p style="font-weight: bold; text-align:center">
|
||||
What are you waiting for?<br />
|
||||
Simplify your life and reduce your risk exposure.<br /><br />
|
||||
<a href="<?= $this->base ?>/users/register">OPEN AN ACCOUNT NOW</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="yui-u">
|
||||
<div id="homeNews">
|
||||
<h3>Latest News</h3>
|
||||
<ul>
|
||||
<? foreach ($this->news as $item): ?>
|
||||
<li>
|
||||
<div>
|
||||
<a href="<?= $item->link['href'] ?>"><?= $item->title ?></a>
|
||||
</div>
|
||||
<div class="newsExcerpt">
|
||||
<?= $item->content ?>
|
||||
</div>
|
||||
</li>
|
||||
<? endforeach ?>
|
||||
</ul> <!-- FF bug -->
|
||||
</div>
|
||||
<div class="borderFadingLeft">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
40
modules/default/views/scripts/index/index-es.phtml
Normal file
40
modules/default/views/scripts/index/index-es.phtml
Normal file
@ -0,0 +1,40 @@
|
||||
<div id="home">
|
||||
<h2>
|
||||
Community ID: Autenticación OpenID gratis<br />
|
||||
Respaldada al 100% con Tecnologías Open Source
|
||||
</h2>
|
||||
<div class="yui-g">
|
||||
<div class="yui-u first">
|
||||
<p>
|
||||
Desde su inicio Community-ID has sido construída con la seguridad como su fundamento más importante. Cada elemento en nuestra pila de tecnologías ha sido escogida de acuerdo a su historial de seguridad. Y lo más importante: todo es Open Source.
|
||||
</p>
|
||||
<p>
|
||||
Esto significa que estamos abiertos al escrutinio del mundo entero. Es ya un hecho provado que la seguridad por obscuridad no funciona, y cuando usted usa un producto o servicio cuyo mecanismo subyacente es guardado como un secreto, está poniendo sus datos (y por ende a usted mismo) bajo un gran riesgo.
|
||||
</p>
|
||||
<p style="font-weight: bold; text-align:center">
|
||||
¿Qué está esperando?<br />
|
||||
Simplifique su vida y reduzca su exposición al riesgo.<br /><br />
|
||||
<a href="<?= $this->base ?>/users/register">ABRA UNA CUENTA AHORA</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="yui-u">
|
||||
<div id="homeNews">
|
||||
<h3>Ultimas Noticias</h3>
|
||||
<ul>
|
||||
<? foreach ($this->news as $item): ?>
|
||||
<li>
|
||||
<div>
|
||||
<a href="<?= $item->link['href'] ?>"><?= $item->title ?></a>
|
||||
</div>
|
||||
<div class="newsExcerpt">
|
||||
<?= $item->content ?>
|
||||
</div>
|
||||
</li>
|
||||
<? endforeach ?>
|
||||
</ul> <!-- FF bug -->
|
||||
</div>
|
||||
<div class="borderFadingLeft">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
1
modules/default/views/scripts/index/subheader-de.phtml
Executable file
1
modules/default/views/scripts/index/subheader-de.phtml
Executable file
@ -0,0 +1 @@
|
||||
<!-- placeholder for home subheader -->
|
1
modules/default/views/scripts/index/subheader-en.phtml
Executable file
1
modules/default/views/scripts/index/subheader-en.phtml
Executable file
@ -0,0 +1 @@
|
||||
<!-- placeholder for home subheader -->
|
1
modules/default/views/scripts/index/subheader-es.phtml
Executable file
1
modules/default/views/scripts/index/subheader-es.phtml
Executable file
@ -0,0 +1 @@
|
||||
<!-- placeholder for home subheader -->
|
54
modules/default/views/scripts/messageusers/index.phtml
Normal file
54
modules/default/views/scripts/messageusers/index.phtml
Normal file
@ -0,0 +1,54 @@
|
||||
<!--[if IE]>
|
||||
<style>
|
||||
/* avoid IE jumping when clearing float here */
|
||||
#messageUsersForm #textareasWrapper dd {
|
||||
clear : none;
|
||||
}
|
||||
</style>
|
||||
<![endif]-->
|
||||
<em><?= $this->translate('This message will be sent to all registered Community-ID users') ?></em>
|
||||
<form id="messageUsersForm" name="messageUsersForm" method="post" action="<?= $this->base ?>/messageusers/send">
|
||||
<input type="hidden" name="messageType" value="rich" />
|
||||
<dl class="shortLabelsForm">
|
||||
<?= $this->messageUsersForm->subject ?>
|
||||
<?= $this->messageUsersForm->cc ?>
|
||||
</dl>
|
||||
<div id="textareasWrapper">
|
||||
<div id="linkSwitchToPlain">
|
||||
<a href="#" onclick="COMMID.messageUsers.switchToPlainText()"><?= $this->translate('switch to Plain-Text') ?></a>
|
||||
</div>
|
||||
<div id="linkSwitchToRich">
|
||||
<a href="#" onclick="COMMID.messageUsers.switchToRichText()"><?= $this->translate('switch to Rich-Text (HTML)') ?></a>
|
||||
</div>
|
||||
<dl class="shortLabelsForm">
|
||||
<!-- can't use the Zend_Form here in order to overcome an IE bug -->
|
||||
<dt id="bodyPlainDt">
|
||||
<label for="bodyPlain" class="optional"><?= $this->translate('Body:') ?></label>
|
||||
</dt>
|
||||
<dd id="bodyPlainDd">
|
||||
<textarea name="bodyPlain" id="bodyPlain" rows="24" cols="80"><?= $this->messageUsersForm->bodyPlain->getValue() ?></textarea>
|
||||
</dd>
|
||||
<dt id="bodyHTMLDt">
|
||||
<label for="bodyHTML" class="optional"><?= $this->translate('Body:') ?></label>
|
||||
</dt>
|
||||
<dd id="bodyHTMLDd">
|
||||
<textarea name="bodyHTML" id="bodyHTML" rows="24" cols="80"><?= $this->messageUsersForm->bodyHTML->getValue() ?></textarea>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<input type="submit" id="send" value="<?= $this->translate('Send') ?>" />
|
||||
<script type="text/javascript">
|
||||
var oButton = new YAHOO.widget.Button("send");
|
||||
</script>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.onDOMReady(function() {
|
||||
COMMID.loader.insert(
|
||||
["resize", "menu", "editor"],
|
||||
function() {
|
||||
COMMID.editor.init('100%','500px', 'bodyHTML');
|
||||
$("messageUsersForm").onsubmit = COMMID.messageUsers.send;
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
10
modules/default/views/scripts/openid/login.phtml
Normal file
10
modules/default/views/scripts/openid/login.phtml
Normal file
@ -0,0 +1,10 @@
|
||||
<div id="article">
|
||||
<form action="authenticate?<?= $this->queryString ?>" method="post">
|
||||
<?= $this->form->openIdIdentity ?>
|
||||
<?= $this->form->password ?>
|
||||
<input type="submit" id="login" value="<?= $this->translate('Login') ?>" />
|
||||
<script type="text/javascript">
|
||||
var oButton = new YAHOO.widget.Button("login");
|
||||
</script>
|
||||
</form>
|
||||
</div>
|
35
modules/default/views/scripts/openid/trust.phtml
Normal file
35
modules/default/views/scripts/openid/trust.phtml
Normal file
@ -0,0 +1,35 @@
|
||||
<div id="article">
|
||||
<div>
|
||||
<?= $this->translate('A site identifying as %s has asked for confirmation that %s is your identity URL.', '<a href="' . $this->siteRoot . '">' . $this->siteRoot . '</a>', '<a href="' . $this->identityUrl . '">' . $this->identityUrl . '</a>') ?>
|
||||
</div>
|
||||
<form method="post" action="provider?<?= $this->queryString ?>" class="formGrid">
|
||||
<input type="hidden" name="action" value="proceed">
|
||||
<? if ($this->fields): ?>
|
||||
<br />
|
||||
<?= $this->translate('It also requests this additional information about you:') ?><br /><br />
|
||||
<?= $this->translate('Fields are automatically filled according to the personal info stored in your community-id account.') ?><br />
|
||||
<?= $this->translate('Fields marked with * are required.') ?>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<? foreach ($this->fields as $field): ?>
|
||||
<?= $field ?>
|
||||
<? endforeach ?>
|
||||
<? if ($this->policyUrl): ?>
|
||||
<?= $this->translate('The private policy can be found at %s',
|
||||
'<a href="'.$this->policyUrl.'">'.$this->policyUrl.'</a>'); ?><br /><br />
|
||||
<? endif ?>
|
||||
<? endif ?>
|
||||
<div style="margin-top:20px">
|
||||
<input type="checkbox" name="forever" style="top:0" /> <?= $this->translate('Forever') ?>
|
||||
</div>
|
||||
<div style="margin-top:20px">
|
||||
<input type="submit" id="allow" name="allow" value="<?= $this->translate('Allow') ?>" />
|
||||
<input type="submit" id="deny" name="deny" value="<?= $this->translate('Deny') ?>" />
|
||||
<script type="text/javascript">
|
||||
var oButton1 = new YAHOO.widget.Button("allow");
|
||||
var oButton2 = new YAHOO.widget.Button("deny");
|
||||
</script>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
4
modules/default/views/scripts/privacy/index.phtml
Normal file
4
modules/default/views/scripts/privacy/index.phtml
Normal file
@ -0,0 +1,4 @@
|
||||
<h2><?= $this->translate('Privacy Policy') ?></h2>
|
||||
<div>
|
||||
<?= $this->privacyPolicy ?>
|
||||
</div>
|
35
modules/default/views/scripts/sites/index.phtml
Normal file
35
modules/default/views/scripts/sites/index.phtml
Normal file
@ -0,0 +1,35 @@
|
||||
<script>
|
||||
YAHOO.util.Event.onDOMReady(function () {
|
||||
COMMID.loader.insert(
|
||||
["datasource", "datatable", "paginator", "json", "connection", "dragdrop", "animation", "container"],
|
||||
function() {
|
||||
COMMID.sitesList.init();
|
||||
COMMID.sitesList.initTable();
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
<div id="paging"></div>
|
||||
<div id="dt"></div>
|
||||
<div id="fieldsDialog">
|
||||
<div class="hd"><?= $this->translate('Information Exchanged') ?></div>
|
||||
<div class="bd">
|
||||
<?= $this->translate('Information exchanged with:') ?><br />
|
||||
<span id="fieldsDialogSite"></span>
|
||||
<div id="fieldsDialogDl" class="formGrid"></div>
|
||||
<div style="text-align:right">
|
||||
<input type="button" id="closeDialog" value="<?= $this->translate('OK') ?>" onclick="COMMID.sitesList.closeDialog()" />
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.onDOMReady(function () {
|
||||
var oButton = new YAHOO.widget.Button(
|
||||
"closeDialog",
|
||||
{
|
||||
type : "push",
|
||||
onclick : {fn: COMMID.sitesList.closeDialog}
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user