import v1.1.0_beta1 | 2009-08-21
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class AboutController extends Monkeys_Controller_Action
|
||||
class AboutController extends CommunityID_Controller_Action
|
||||
{
|
||||
protected $_numCols = 1;
|
||||
|
||||
|
54
modules/default/controllers/CidController.php
Normal file
54
modules/default/controllers/CidController.php
Normal 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 CidController extends CommunityID_Controller_Action
|
||||
{
|
||||
const NEWS_CONTENT_MAX_LENGTH = 100;
|
||||
const NEWS_NUM_ITEMS = 6;
|
||||
|
||||
protected $_numCols = 2;
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$this->view->version = Application::VERSION;
|
||||
|
||||
try {
|
||||
$feed = Zend_Feed::import('http://source.keyboard-monkeys.org/projects/communityid/news?format=atom');
|
||||
} 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++ >= self::NEWS_NUM_ITEMS) {
|
||||
break;
|
||||
}
|
||||
|
||||
// ATOM uses <link href="foo" />, while RSS uses <link>foo</link>
|
||||
$item->link = $item->link['href']? $item->link['href'] : $item->link;
|
||||
|
||||
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.'">' . $this->view->translate('Read More') . '</a>';
|
||||
}
|
||||
$this->view->news[] = $item;
|
||||
}
|
||||
|
||||
$this->_helper->actionStack('index', 'login', 'users');
|
||||
}
|
||||
}
|
@ -9,7 +9,7 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class FeedbackController extends Monkeys_Controller_Action
|
||||
class FeedbackController extends CommunityID_Controller_Action
|
||||
{
|
||||
protected $_numCols = 1;
|
||||
|
||||
@ -17,7 +17,7 @@ class FeedbackController extends Monkeys_Controller_Action
|
||||
{
|
||||
parent::init();
|
||||
|
||||
if ($this->user->role != User::ROLE_ADMIN && $this->underMaintenance) {
|
||||
if ($this->user->role != Users_Model_User::ROLE_ADMIN && $this->underMaintenance) {
|
||||
return $this->_redirectForMaintenance();
|
||||
}
|
||||
}
|
||||
@ -29,14 +29,14 @@ class FeedbackController extends Monkeys_Controller_Action
|
||||
$form = $appSession->feedbackForm;
|
||||
unset($appSession->feedbackForm);
|
||||
} else {
|
||||
$form = new FeedbackForm(null, $this->view->base);
|
||||
$form = new Form_Feedback(null, $this->view->base);
|
||||
}
|
||||
$this->view->form = $form;
|
||||
}
|
||||
|
||||
public function sendAction()
|
||||
{
|
||||
$form = new FeedbackForm(null, $this->view->base);
|
||||
$form = new Form_Feedback(null, $this->view->base);
|
||||
$formData = $this->_request->getPost();
|
||||
$form->populate($formData);
|
||||
|
||||
@ -102,7 +102,7 @@ Feedback:
|
||||
$feedback
|
||||
EOD
|
||||
);
|
||||
$mail->setFrom($this->_config->email->supportemail);
|
||||
$mail->setFrom($configEmail->supportemail);
|
||||
$mail->addTo($configEmail->supportemail);
|
||||
$mail->setSubject('Community-ID feedback form');
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class HistoryController extends Monkeys_Controller_Action
|
||||
class HistoryController extends CommunityID_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
@ -20,11 +20,13 @@ class HistoryController extends Monkeys_Controller_Action
|
||||
{
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$histories = new Histories();
|
||||
$histories = new Model_Histories();
|
||||
$historiesRows = $histories->get(
|
||||
$this->user,
|
||||
$this->_getParam('startIndex'),
|
||||
$this->_getParam('results')
|
||||
$this->_getParam('results'),
|
||||
$this->_getParam('sort', 'date'),
|
||||
$this->_getParam('dir', Model_Histories::DIR_DESC)
|
||||
);
|
||||
|
||||
$jsonObj = new StdClass();
|
||||
@ -53,7 +55,7 @@ class HistoryController extends Monkeys_Controller_Action
|
||||
{
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$histories = new Histories();
|
||||
$histories = new Model_Histories();
|
||||
$histories->clear($this->user);
|
||||
|
||||
$json = new StdClass();
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class IdentityController extends Monkeys_Controller_Action
|
||||
class IdentityController extends CommunityID_Controller_Action
|
||||
{
|
||||
protected $_numCols = 1;
|
||||
|
||||
@ -20,39 +20,15 @@ class IdentityController extends Monkeys_Controller_Action
|
||||
|
||||
public function idAction()
|
||||
{
|
||||
$currentUrl = Zend_OpenId::selfURL();
|
||||
$this->view->headLink()->headLink(array(
|
||||
'rel' => 'openid.server',
|
||||
'href' => $this->_helper->ProviderUrl($this->_config)
|
||||
));
|
||||
$this->view->headLink()->headLink(array(
|
||||
'rel' => 'openid2.provider',
|
||||
'href' => $this->_helper->ProviderUrl($this->_config)
|
||||
));
|
||||
|
||||
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;
|
||||
$this->view->idUrl = urldecode(Zend_OpenId::selfURL());
|
||||
}
|
||||
}
|
||||
|
@ -9,9 +9,9 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class IndexController extends Monkeys_Controller_Action
|
||||
class IndexController extends CommunityID_Controller_Action
|
||||
{
|
||||
const NEWS_CONTENT_MAX_LENGTH = 100;
|
||||
const NEWS_NUMBER = 4;
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
@ -41,31 +41,8 @@ class IndexController extends Monkeys_Controller_Action
|
||||
|
||||
$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;
|
||||
}
|
||||
$news = new News_Model_News();
|
||||
$this->view->news = $news->getLatest(self::NEWS_NUMBER, $this->user);
|
||||
|
||||
$view = false;
|
||||
foreach ($scriptsDir as $scriptDir) {
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class LearnmoreController extends Monkeys_Controller_Action
|
||||
class LearnmoreController extends CommunityID_Controller_Action
|
||||
{
|
||||
protected $_numCols = 1;
|
||||
|
||||
|
@ -9,26 +9,18 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class MaintenancemodeController extends Monkeys_Controller_Action
|
||||
class MaintenancemodeController extends CommunityID_Controller_Action
|
||||
{
|
||||
private $_settings;
|
||||
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
$this->_settings = new Settings();
|
||||
}
|
||||
|
||||
public function enableAction()
|
||||
{
|
||||
$this->_settings->set(Settings::MAINTENANCE_MODE, 1);
|
||||
$this->_settings->set(Model_Settings::MAINTENANCE_MODE, 1);
|
||||
|
||||
$this->_redirect('');
|
||||
}
|
||||
|
||||
public function disableAction()
|
||||
{
|
||||
$this->_settings->set(Settings::MAINTENANCE_MODE, 0);
|
||||
$this->_settings->set(Model_Settings::MAINTENANCE_MODE, 0);
|
||||
|
||||
$this->_redirect('');
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class MessageusersController extends Monkeys_Controller_Action
|
||||
class MessageusersController extends CommunityID_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
@ -18,7 +18,7 @@ class MessageusersController extends Monkeys_Controller_Action
|
||||
$this->view->messageUsersForm = $appSession->messageUsersForm;
|
||||
unset($appSession->messageUsersForm);
|
||||
} else {
|
||||
$this->view->messageUsersForm = new MessageUsersForm();
|
||||
$this->view->messageUsersForm = new Form_MessageUsers();
|
||||
}
|
||||
|
||||
$this->_helper->actionStack('index', 'login', 'users');
|
||||
@ -26,7 +26,7 @@ class MessageusersController extends Monkeys_Controller_Action
|
||||
|
||||
public function sendAction()
|
||||
{
|
||||
$form = new MessageUsersForm();
|
||||
$form = new Form_MessageUsers();
|
||||
$formData = $this->_request->getPost();
|
||||
|
||||
$form->populate($formData);
|
||||
@ -35,13 +35,13 @@ class MessageusersController extends Monkeys_Controller_Action
|
||||
}
|
||||
|
||||
$cc = $form->getValue('cc');
|
||||
$ccArr = array();
|
||||
$bccArr = 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])) {
|
||||
$bccArr = explode(',', $cc);
|
||||
for ($i = 0; $i < count($bccArr); $i++) {
|
||||
$bccArr[$i] = trim($bccArr[$i]);
|
||||
if (!$validator->isValid($bccArr[$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);
|
||||
@ -65,13 +65,17 @@ class MessageusersController extends Monkeys_Controller_Action
|
||||
$mail->setBodyHtml($form->getValue('bodyHTML'));
|
||||
}
|
||||
|
||||
$users = new Users();
|
||||
$users = new Users_Model_Users();
|
||||
foreach ($users->getUsers() as $user) {
|
||||
$mail->addTo($user->email);
|
||||
if ($user->role == ROLE_ADMIN) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$mail->addBcc($user->email);
|
||||
}
|
||||
|
||||
foreach ($ccArr as $cc) {
|
||||
$mail->addCC($cc);
|
||||
foreach ($bccArr as $bcc) {
|
||||
$mail->addBcc($bcc);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -122,7 +126,10 @@ class MessageusersController extends Monkeys_Controller_Action
|
||||
}
|
||||
|
||||
$mail = new Zend_Mail('UTF-8');
|
||||
$mail->setFrom($this->_config->email->supportemail);
|
||||
$mail->setFrom($configEmail->supportemail);
|
||||
|
||||
// all recipients will be in BCC, but I need at least one in the To header
|
||||
$mail->addTo($configEmail->supportemail);
|
||||
|
||||
return $mail;
|
||||
}
|
||||
|
@ -9,167 +9,292 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class OpenidController extends Monkeys_Controller_Action
|
||||
class OpenidController extends CommunityID_Controller_Action
|
||||
{
|
||||
protected $_numCols = 1;
|
||||
|
||||
public function providerAction()
|
||||
{
|
||||
if (isset($_POST['action']) && $_POST['action'] == 'proceed') {
|
||||
return $this->_proceed();
|
||||
} else {
|
||||
Zend_OpenId::$exitOnRedirect = false;
|
||||
$server = $this->_getOpenIdProvider();
|
||||
$request = $server->decodeRequest();
|
||||
$sites = new Model_Sites();
|
||||
|
||||
$this->_helper->layout->disableLayout();
|
||||
if (!$request) {
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
header('HTTP/1.0 403 Forbidden');
|
||||
Zend_Registry::get('logger')->log("OpenIdController::providerAction: FORBIDDEN", Zend_Log::DEBUG);
|
||||
echo 'Forbidden';
|
||||
return;
|
||||
}
|
||||
|
||||
$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'))
|
||||
// association and other transactions, handled automatically by the framework
|
||||
if (!in_array($request->mode, array('checkid_immediate', 'checkid_setup'))) {
|
||||
return $this->_sendResponse($server, $server->handleRequest($request));
|
||||
}
|
||||
|
||||
{
|
||||
$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);
|
||||
// can't process immediate requests if user is not logged in
|
||||
if ($request->immediate && $this->user->role == Users_Model_User::ROLE_GUEST) {
|
||||
return $this->_sendResponse($server, $request->answer(false));
|
||||
}
|
||||
|
||||
if ($request->idSelect()) {
|
||||
if ($this->user->role == Users_Model_User::ROLE_GUEST) {
|
||||
$this->_forward('login');
|
||||
} else {
|
||||
if ($sites->isTrusted($this->user, $request->trust_root)) {
|
||||
$this->_forward('proceed', null, null, array('allow' => true));
|
||||
} elseif ($sites->isNeverTrusted($this->user, $request->trust_root)) {
|
||||
$this->_forward('proceed', null, null, array('allow' => false));
|
||||
} else {
|
||||
if ($request->immediate) {
|
||||
return $this->_sendResponse($server, $request->answer(false));
|
||||
}
|
||||
|
||||
$this->_forward('trust');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!$request->identity) {
|
||||
die('No identifier sent by OpenID relay');
|
||||
}
|
||||
|
||||
if ($this->user->role == Users_Model_User::ROLE_GUEST) {
|
||||
$this->_forward('login');
|
||||
} else {
|
||||
// user is logged-in already. Check the requested identity is his
|
||||
if ($this->user->openid != $request->identity) {
|
||||
Zend_Auth::getInstance()->clearIdentity();
|
||||
if ($this->immediate) {
|
||||
return $this->_sendResponse($server, $request->answer(false));
|
||||
}
|
||||
|
||||
$this->_forward('login');
|
||||
} else {
|
||||
if ($sites->isTrusted($this->user, $request->trust_root)) {
|
||||
$this->_forward('proceed', null, null, array('allow' => true));
|
||||
} elseif ($sites->isNeverTrusted($this->user, $request->trust_root)) {
|
||||
$this->_forward('proceed', null, null, array('deny' => true));
|
||||
} else {
|
||||
$this->_saveHistory($server, History::AUTHORIZED);
|
||||
$this->_forward('trust');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We don't use the session with the login form to simplify the dynamic appearance of the captcha
|
||||
*/
|
||||
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']));
|
||||
$server = $this->_getOpenIdProvider();
|
||||
$request = $server->decodeRequest();
|
||||
|
||||
$this->view->queryString = $_SERVER['QUERY_STRING'];
|
||||
$authAttempts = new Users_Model_AuthAttempts();
|
||||
$attempt = $authAttempts->get();
|
||||
$this->view->useCaptcha = $attempt && $attempt->surpassedMaxAllowed();
|
||||
$this->view->form = new Form_OpenidLogin(null, $this->view->base, $attempt && $attempt->surpassedMaxAllowed());
|
||||
|
||||
if (!$request->idSelect()) {
|
||||
$this->view->form->openIdIdentity->setValue(htmlspecialchars($request->identity));
|
||||
}
|
||||
|
||||
$this->view->queryString = $this->_queryString();
|
||||
}
|
||||
|
||||
public function authenticateAction()
|
||||
{
|
||||
$form = new OpenidLoginForm();
|
||||
$server = $this->_getOpenIdProvider();
|
||||
$request = $server->decodeRequest();
|
||||
|
||||
$authAttempts = new Users_Model_AuthAttempts();
|
||||
$attempt = $authAttempts->get();
|
||||
|
||||
$form = new Form_OpenidLogin(null, $this->view->base, $attempt && $attempt->surpassedMaxAllowed());
|
||||
$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);
|
||||
$this->_forward('login');
|
||||
return;
|
||||
}
|
||||
|
||||
$server = $this->_getOpenIdProvider();
|
||||
$server->login($form->getValue('openIdIdentity'), $form->getValue('password'));
|
||||
$users = new Users_Model_Users();
|
||||
$result = $users->authenticate($form->getValue('openIdIdentity'),
|
||||
$form->getValue('password'), true);
|
||||
|
||||
// needed for unit tests
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
Zend_OpenId::redirect($this->view->base . '/openid/provider', $_GET);
|
||||
if ($result) {
|
||||
if ($attempt) {
|
||||
$attempt->delete();
|
||||
}
|
||||
$sites = new Model_Sites();
|
||||
if ($sites->isTrusted($users->getUser(), $request->trust_root)) {
|
||||
$this->_forward('proceed', null, null, array('allow' => true));
|
||||
} elseif ($sites->isNeverTrusted($users->getUser(), $request->trust_root)) {
|
||||
$this->_forward('proceed', null, null, array('deny' => true));
|
||||
} else {
|
||||
$this->_forward('trust');
|
||||
}
|
||||
} else {
|
||||
if (!$attempt) {
|
||||
$authAttempts->create();
|
||||
} else {
|
||||
$attempt->addFailure();
|
||||
$attempt->save();
|
||||
}
|
||||
$this->_forward('login');
|
||||
}
|
||||
}
|
||||
|
||||
public function trustAction()
|
||||
{
|
||||
$server = $this->_getOpenIdProvider();
|
||||
$this->view->siteRoot = $server->getSiteRoot($_GET);
|
||||
$this->view->identityUrl = $server->getLoggedInUser($_GET);
|
||||
$this->view->queryString = $_SERVER['QUERY_STRING'];
|
||||
$request = $server->decodeRequest();
|
||||
|
||||
$sreg = new Zend_OpenId_Extension_Sreg();
|
||||
$sreg->parseRequest($_GET);
|
||||
$this->view->siteRoot = $request->trust_root;
|
||||
$this->view->identityUrl = $this->user->openid;
|
||||
$this->view->queryString = $this->_queryString();
|
||||
|
||||
$this->view->fields = array();
|
||||
$this->view->policyUrl = false;
|
||||
|
||||
$props = $sreg->getProperties();
|
||||
// The class Auth_OpenID_SRegRequest is included in the following file
|
||||
require 'libs/Auth/OpenID/SReg.php';
|
||||
|
||||
$sregRequest = Auth_OpenID_SRegRequest::fromOpenIDRequest($request);
|
||||
$props = $sregRequest->allRequestedFields();
|
||||
$args = $sregRequest->getExtensionArgs();
|
||||
if (isset($args['required'])) {
|
||||
$required = explode(',', $args['required']);
|
||||
} else {
|
||||
$required = false;
|
||||
}
|
||||
|
||||
if (is_array($props) && count($props) > 0) {
|
||||
$personalInfoForm = new PersonalInfoForm(null, $this->user, $props);
|
||||
$sregProps = array();
|
||||
foreach ($props as $field) {
|
||||
$sregProps[$field] = $required && in_array($field, $required);
|
||||
}
|
||||
|
||||
$personalInfoForm = new Users_Form_PersonalInfo(null, $this->user, $sregProps);
|
||||
$this->view->fields = $personalInfoForm->getElements();
|
||||
|
||||
$policy = $sreg->getPolicyUrl();
|
||||
if (!empty($policy)) {
|
||||
$this->view->policyUrl = $policy;
|
||||
if (isset($args['policy_url'])) {
|
||||
$this->view->policyUrl = $args['policy_url'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function _proceed()
|
||||
public function proceedAction()
|
||||
{
|
||||
if ($this->user->role == User::ROLE_GUEST) {
|
||||
throw new Monkeys_AccessDeniedException();
|
||||
}
|
||||
|
||||
// needed for unit tests
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$server = $this->_getOpenIdProvider();
|
||||
$request = $server->decodeRequest();
|
||||
|
||||
$sreg = new Zend_OpenId_Extension_Sreg();
|
||||
$sreg->parseRequest($_GET);
|
||||
$props = $sreg->getProperties();
|
||||
if ($request->idSelect()) {
|
||||
$id = $this->user->openid;
|
||||
} else {
|
||||
$id = null;
|
||||
}
|
||||
|
||||
$personalInfoForm = new PersonalInfoForm(null, $this->user, $props);
|
||||
$formData = $this->_request->getPost();
|
||||
$personalInfoForm->populate($formData);
|
||||
$response = $request->answer(true, null, $id);
|
||||
|
||||
// not planning on validating stuff here yet, but I call this
|
||||
// for the date element to be filled properly
|
||||
$personalInfoForm->isValid($formData);
|
||||
// The class Auth_OpenID_SRegRequest is included in the following file
|
||||
require 'libs/Auth/OpenID/SReg.php';
|
||||
|
||||
$sreg->parseResponse($personalInfoForm->getValues());
|
||||
if (isset($_POST['allow'])) {
|
||||
if (isset($_POST['forever'])) {
|
||||
$server->allowSite($server->getSiteRoot($_GET), $sreg);
|
||||
}
|
||||
unset($_GET['openid_action']);
|
||||
$sregRequest = Auth_OpenID_SRegRequest::fromOpenIDRequest($request);
|
||||
$props = $sregRequest->allRequestedFields();
|
||||
$args = $sregRequest->getExtensionArgs();
|
||||
if (isset($args['required'])) {
|
||||
$required = explode(',', $args['required']);
|
||||
} else {
|
||||
$required = false;
|
||||
}
|
||||
|
||||
$this->_saveHistory($server, History::AUTHORIZED);
|
||||
|
||||
$server->respondToConsumer($_GET, $sreg);
|
||||
} else if (isset($_POST['deny'])) {
|
||||
if (isset($_POST['forever'])) {
|
||||
$server->denySite($server->getSiteRoot($_GET));
|
||||
if (is_array($props) && count($props) > 0) {
|
||||
$sregProps = array();
|
||||
foreach ($props as $field) {
|
||||
$sregProps[$field] = $required && in_array($field, $required);
|
||||
}
|
||||
|
||||
$this->_saveHistory($server, History::DENIED);
|
||||
$personalInfoForm = new Users_Form_PersonalInfo(null, $this->user, $sregProps);
|
||||
$formData = $this->_request->getPost();
|
||||
$personalInfoForm->populate($formData);
|
||||
|
||||
Zend_OpenId::redirect($_GET['openid_return_to'], array('openid.mode'=>'cancel'));
|
||||
// not planning on validating stuff here yet, but I call this
|
||||
// for the date element to be filled properly
|
||||
$personalInfoForm->isValid($formData);
|
||||
|
||||
$sregResponse = Auth_OpenID_SRegResponse::extractResponse($sregRequest,
|
||||
$personalInfoForm->getUnqualifiedValues());
|
||||
$sregResponse->toMessage($response->fields);
|
||||
}
|
||||
|
||||
if ($this->_getParam('allow')) {
|
||||
if ($this->_getParam('forever')) {
|
||||
|
||||
$sites = new Model_Sites();
|
||||
$sites->deleteForUserSite($this->user, $request->trust_root);
|
||||
|
||||
$siteObj = $sites->createRow();
|
||||
$siteObj->user_id = $this->user->id;
|
||||
$siteObj->site = $request->trust_root;
|
||||
$siteObj->creation_date = date('Y-m-d');
|
||||
|
||||
if (isset($personalInfoForm)) {
|
||||
$trusted = array();
|
||||
// using this key name for BC pre 1.1 when we used Zend_OpenId
|
||||
$trusted['Zend_OpenId_Extension_Sreg'] = $personalInfoForm->getUnqualifiedValues();
|
||||
} else {
|
||||
$trusted = true;
|
||||
}
|
||||
$siteObj->trusted = serialize($trusted);
|
||||
|
||||
$siteObj->save();
|
||||
}
|
||||
|
||||
$this->_saveHistory($request->trust_root, Model_History::AUTHORIZED);
|
||||
|
||||
$webresponse = $server->encodeResponse($response);
|
||||
|
||||
foreach ($webresponse->headers as $k => $v) {
|
||||
header("$k: $v");
|
||||
}
|
||||
|
||||
header('Connection: close');
|
||||
echo $webresponse->body;
|
||||
} elseif ($this->_getParam('deny')) {
|
||||
if ($this->_getParam('forever')) {
|
||||
$sites = new Model_Sites();
|
||||
$sites->deleteForUserSite($this->user, $request->trust_root);
|
||||
|
||||
$siteObj = $sites->createRow();
|
||||
$siteObj->user_id = $this->user->id;
|
||||
$siteObj->site = $request->trust_root;
|
||||
$siteObj->creation_date = date('Y-m-d');
|
||||
$siteObj->trusted = serialize(false);
|
||||
$siteObj->save();
|
||||
}
|
||||
|
||||
$this->_saveHistory($request->trust_root, Model_History::DENIED);
|
||||
|
||||
header('HTTP/1.1 302 Found');
|
||||
header('Content-Type: text/plain; charset=us-ascii');
|
||||
header('Connection: close');
|
||||
header('Location: ' . $request->getCancelUrl());
|
||||
}
|
||||
}
|
||||
private function _saveHistory(Zend_OpenId_Provider $server, $result)
|
||||
{
|
||||
// only log if user exists
|
||||
if ($this->user->role == User::ROLE_GUEST) {
|
||||
return;
|
||||
}
|
||||
|
||||
$histories = new Histories();
|
||||
private function _saveHistory($site, $result)
|
||||
{
|
||||
$histories = new Model_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->site = $site;
|
||||
$history->ip = $_SERVER['REMOTE_ADDR'];
|
||||
$history->result = $result;
|
||||
$history->save();
|
||||
@ -177,11 +302,64 @@ class OpenidController extends Monkeys_Controller_Action
|
||||
|
||||
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());
|
||||
$connection = new CommunityID_OpenId_DatabaseConnection(Zend_Registry::get('db'));
|
||||
$store = new Auth_OpenID_MySQLStore($connection, 'associations', 'nonces');
|
||||
$server = new Auth_OpenID_Server($store, $this->_helper->ProviderUrl($this->_config));
|
||||
|
||||
return $server;
|
||||
}
|
||||
|
||||
private function _sendResponse(Auth_OpenID_Server $server, Auth_OpenID_ServerResponse $response)
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$webresponse = $server->encodeResponse($response);
|
||||
|
||||
if ($webresponse->code != AUTH_OPENID_HTTP_OK) {
|
||||
header(sprintf("HTTP/1.1 %d ", $webresponse->code), true, $webresponse->code);
|
||||
}
|
||||
|
||||
foreach ($webresponse->headers as $k => $v) {
|
||||
header("$k: $v");
|
||||
}
|
||||
|
||||
header('Connection: close');
|
||||
|
||||
echo $webresponse->body;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Circumvent PHP's automatic replacement of dots by underscore in var names in $_GET and $_POST
|
||||
*/
|
||||
private function _queryString()
|
||||
{
|
||||
$unfilteredVars = array_merge($_GET, $_POST);
|
||||
$varsTemp = array();
|
||||
$vars = array();
|
||||
$extensions = array();
|
||||
foreach ($unfilteredVars as $key => $value) {
|
||||
if (substr($key, 0, 10) == 'openid_ns_') {
|
||||
$extensions[] = substr($key, 10);
|
||||
$varsTemp[str_replace('openid_ns_', 'openid.ns.', $key)] = $value;
|
||||
} else {
|
||||
$varsTemp[str_replace('openid_', 'openid.', $key)] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($extensions as $extension) {
|
||||
foreach ($varsTemp as $key => $value) {
|
||||
if (strpos($key, "openid.$extension") === 0) {
|
||||
$prefix = "openid.$extension.";
|
||||
$key = $prefix . substr($key, strlen($prefix));
|
||||
}
|
||||
$vars[$key] = $value;
|
||||
}
|
||||
}
|
||||
if (!$extensions) {
|
||||
$vars = $varsTemp;
|
||||
}
|
||||
|
||||
return '?' . http_build_query($vars);
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class PrivacyController extends Monkeys_Controller_Action
|
||||
class PrivacyController extends CommunityID_Controller_Action
|
||||
{
|
||||
protected $_numCols = 1;
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class SitesController extends Monkeys_Controller_Action
|
||||
class SitesController extends CommunityID_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
@ -20,8 +20,8 @@ class SitesController extends Monkeys_Controller_Action
|
||||
{
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$fields = new Fields();
|
||||
$sites = new Sites();
|
||||
$fields = new Model_Fields();
|
||||
$sites = new Model_Sites();
|
||||
$sitesRows = $sites->get(
|
||||
$this->user,
|
||||
$this->_getParam('startIndex'),
|
||||
@ -67,7 +67,7 @@ class SitesController extends Monkeys_Controller_Action
|
||||
{
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$sites = new Sites();
|
||||
$sites = new Model_Sites();
|
||||
$site = $sites->getRowInstance($this->_getParam('id'));
|
||||
if ($site->user_id != $this->user->id) {
|
||||
throw new Monkeys_AccessDeniedException();
|
||||
@ -86,7 +86,7 @@ class SitesController extends Monkeys_Controller_Action
|
||||
{
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$sites = new Sites();
|
||||
$sites = new Model_Sites();
|
||||
$site = $sites->getRowInstance($this->_getParam('id'));
|
||||
if ($site->user_id != $this->user->id) {
|
||||
throw new Monkeys_AccessDeniedException();
|
||||
@ -105,7 +105,7 @@ class SitesController extends Monkeys_Controller_Action
|
||||
{
|
||||
$this->_helper->viewRenderer->setNeverRender(true);
|
||||
|
||||
$sites = new Sites();
|
||||
$sites = new Model_Sites();
|
||||
$site = $sites->getRowInstance($this->_getParam('id'));
|
||||
if ($site->user_id != $this->user->id) {
|
||||
throw new Monkeys_AccessDeniedException();
|
||||
|
@ -4,8 +4,8 @@
|
||||
* @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
|
||||
* @since CommunityID 0.9
|
||||
* @package CommunityID
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
* 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
|
||||
class Form_ErrorMessages
|
||||
{
|
||||
private function _messages()
|
||||
{
|
||||
@ -24,5 +24,6 @@ class ErrorMessages
|
||||
translate('\'%value%\' appears to be a local network name but local network names are not allowed');
|
||||
translate('Captcha value is wrong');
|
||||
translate('Password confirmation does not match');
|
||||
translate('Username can only contain US-ASCII alphanumeric characters, plus any of the symbols $-_.+!*\'(), and "');
|
||||
}
|
||||
}
|
||||
|
61
modules/default/forms/Feedback.php
Normal file
61
modules/default/forms/Feedback.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 Form_Feedback 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/MessageUsers.php
Normal file
34
modules/default/forms/MessageUsers.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 Form_MessageUsers extends Zend_Form
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$subject = new Monkeys_Form_Element_Text('subject');
|
||||
translate('Subject:');
|
||||
$subject->setLabel('Subject')
|
||||
->setRequired(true);
|
||||
|
||||
$cc = new Monkeys_Form_Element_Text('cc');
|
||||
translate('CC:');
|
||||
$cc->setLabel('CC');
|
||||
|
||||
$bodyPlain = new Monkeys_Form_Element_Textarea('bodyPlain');
|
||||
$bodyPlain->setDecoratorOptions(array('separateLine' => true));
|
||||
|
||||
$bodyHTML= new Monkeys_Form_Element_Richtextarea('bodyHTML');
|
||||
$bodyHTML->setDecoratorOptions(array('separateLine' => true))
|
||||
->setAttrib('width', '510px');
|
||||
|
||||
$this->addElements(array($subject, $cc, $bodyPlain, $bodyHTML));
|
||||
}
|
||||
}
|
63
modules/default/forms/OpenidLogin.php
Normal file
63
modules/default/forms/OpenidLogin.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?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 Form_OpenIdLogin extends Zend_Form
|
||||
{
|
||||
private $_baseWebDir;
|
||||
private $_useCaptcha;
|
||||
|
||||
public function __construct($options = null, $baseWebDir = null, $useCaptcha= false)
|
||||
{
|
||||
$this->_baseWebDir = $baseWebDir;
|
||||
$this->_useCaptcha = $useCaptcha;
|
||||
parent::__construct($options);
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
$openIdIdentity = new Monkeys_Form_Element_Text('openIdIdentity');
|
||||
translate('OpenID URL');
|
||||
$openIdIdentity->setLabel('OpenID URL')
|
||||
->setDecoratorOptions(array('dontMarkRequired' => true))
|
||||
->setAttrib('style', 'width:300px')
|
||||
->setRequired(true);
|
||||
|
||||
$password = new Monkeys_Form_Element_Password('password');
|
||||
translate('Password');
|
||||
$password->setLabel('Password')
|
||||
->setDecoratorOptions(array('dontMarkRequired' => true))
|
||||
->setAttrib('style', 'width:300px')
|
||||
->setRequired(true);
|
||||
|
||||
$this->addElements(array($openIdIdentity, $password));
|
||||
|
||||
if ($this->_useCaptcha) {
|
||||
$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' => WEB_DIR. '/captchas',
|
||||
'imgUrl' => $this->_baseWebDir . '/captchas',
|
||||
'wordLen' => 4,
|
||||
'fontSize' => 30,
|
||||
'timeout' => 300,
|
||||
)
|
||||
));
|
||||
$captcha->setDecoratorOptions(array(
|
||||
'dontMarkRequired' => true,
|
||||
));
|
||||
|
||||
$this->addElement($captcha);
|
||||
}
|
||||
}
|
||||
}
|
@ -10,6 +10,6 @@
|
||||
*/
|
||||
|
||||
|
||||
class Association extends Zend_Db_Table_Row_Abstract
|
||||
class Model_Association extends Zend_Db_Table_Row_Abstract
|
||||
{
|
||||
}
|
||||
|
@ -10,11 +10,11 @@
|
||||
*/
|
||||
|
||||
|
||||
class Associations extends Monkeys_Db_Table_Gateway
|
||||
class Model_Associations extends Monkeys_Db_Table_Gateway
|
||||
{
|
||||
protected $_name = 'associations';
|
||||
protected $_primary = 'handle';
|
||||
protected $_rowClass = 'Association';
|
||||
protected $_rowClass = 'Model_Association';
|
||||
|
||||
public function getAssociationGivenHandle($handle)
|
||||
{
|
||||
|
@ -10,7 +10,7 @@
|
||||
*/
|
||||
|
||||
|
||||
class Field extends Zend_Db_Table_Row_Abstract
|
||||
class Model_Field extends Zend_Db_Table_Row_Abstract
|
||||
{
|
||||
const TYPE_TEXT = 1;
|
||||
const TYPE_DATE = 2;
|
||||
|
@ -10,15 +10,15 @@
|
||||
*/
|
||||
|
||||
|
||||
class Fields extends Monkeys_Db_Table_Gateway
|
||||
class Model_Fields extends Monkeys_Db_Table_Gateway
|
||||
{
|
||||
protected $_name = 'fields';
|
||||
protected $_primary = 'id';
|
||||
protected $_rowClass = 'Field';
|
||||
protected $_rowClass = 'Model_Field';
|
||||
|
||||
private $_fieldsNames= array();
|
||||
|
||||
public function getValues(User $user)
|
||||
public function getValues(Users_Model_User $user)
|
||||
{
|
||||
$userId = (int)$user->id;
|
||||
$select = $this->select()
|
||||
|
@ -10,6 +10,6 @@
|
||||
*/
|
||||
|
||||
|
||||
class FieldsValue extends Zend_Db_Table_Row_Abstract
|
||||
class Model_FieldsValue extends Zend_Db_Table_Row_Abstract
|
||||
{
|
||||
}
|
||||
|
@ -10,13 +10,13 @@
|
||||
*/
|
||||
|
||||
|
||||
class FieldsValues extends Monkeys_Db_Table_Gateway
|
||||
class Model_FieldsValues extends Monkeys_Db_Table_Gateway
|
||||
{
|
||||
protected $_name = 'fields_values';
|
||||
protected $_primary = array('user_id', 'field_id');
|
||||
protected $_rowClass = 'FieldsValue';
|
||||
protected $_rowClass = 'Model_FieldsValue';
|
||||
|
||||
public function deleteForUser(User $user)
|
||||
public function deleteForUser(Users_Model_User $user)
|
||||
{
|
||||
$where = $this->getAdapter()->quoteInto('user_id=?', $user->id);
|
||||
$this->delete($where);
|
||||
|
@ -10,17 +10,37 @@
|
||||
*/
|
||||
|
||||
|
||||
class Histories extends Monkeys_Db_Table_Gateway
|
||||
class Model_Histories extends Monkeys_Db_Table_Gateway
|
||||
{
|
||||
const DIR_ASC = 0;
|
||||
const DIR_DESC = 1;
|
||||
|
||||
private $_sortFields = array(
|
||||
'date' => array('date', 'site', 'ip', 'result'),
|
||||
'site' => array('site', 'date', 'ip', 'result'),
|
||||
'ip' => array('ip', 'date', 'site', 'result'),
|
||||
'result' => array('result', 'date', 'site', 'ip'),
|
||||
);
|
||||
|
||||
protected $_name = 'history';
|
||||
protected $_primary = 'id';
|
||||
protected $_rowClass = 'History';
|
||||
protected $_rowClass = 'Model_History';
|
||||
|
||||
public function get(User $user, $startIndex, $results)
|
||||
public function get(Users_Model_User $user, $startIndex = false, $results = false, $sort = false, $dir = false)
|
||||
{
|
||||
$select = $this->select()
|
||||
->where('user_id=?', $user->id);
|
||||
|
||||
if ($sort && isset($this->_sortFields[$sort])) {
|
||||
$dir = ($dir == self::DIR_ASC? 'ASC' : 'DESC');
|
||||
$sortSql = array();
|
||||
foreach ($this->_sortFields[$sort] as $field) {
|
||||
$sortSql[] = "$field $dir";
|
||||
}
|
||||
|
||||
$select = $select->order($sortSql);
|
||||
}
|
||||
|
||||
if ($startIndex !== false && $results !== false) {
|
||||
$select = $select->limit($results, $startIndex);
|
||||
}
|
||||
@ -28,14 +48,14 @@ class Histories extends Monkeys_Db_Table_Gateway
|
||||
return $this->fetchAll($select);
|
||||
}
|
||||
|
||||
public function getNumHistories(User $user)
|
||||
public function getNumHistories(Users_Model_User $user)
|
||||
{
|
||||
$sites = $this->get($user, false, false);
|
||||
$sites = $this->get($user);
|
||||
|
||||
return count($sites);
|
||||
}
|
||||
|
||||
public function clear(User $user)
|
||||
public function clear(Users_Model_User $user)
|
||||
{
|
||||
$where = $this->getAdapter()->quoteInto('user_id=?', $user->id);
|
||||
$this->delete($where);
|
||||
|
@ -10,7 +10,7 @@
|
||||
*/
|
||||
|
||||
|
||||
class History extends Zend_Db_Table_Row_Abstract
|
||||
class Model_History extends Zend_Db_Table_Row_Abstract
|
||||
{
|
||||
const DENIED = 0;
|
||||
const AUTHORIZED = 1;
|
||||
|
@ -9,12 +9,13 @@
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class Settings extends Monkeys_Db_Table_Gateway
|
||||
class Model_Settings extends Monkeys_Db_Table_Gateway
|
||||
{
|
||||
protected $_name = 'settings';
|
||||
protected $_primary = 'name';
|
||||
|
||||
const MAINTENANCE_MODE = 'maintenance_mode';
|
||||
const VERSION = 'version';
|
||||
|
||||
public function get($name)
|
||||
{
|
||||
@ -23,6 +24,10 @@ class Settings extends Monkeys_Db_Table_Gateway
|
||||
|
||||
$row = $this->fetchRow($select);
|
||||
|
||||
if (!$row) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $row->value;
|
||||
}
|
||||
|
||||
@ -35,4 +40,9 @@ class Settings extends Monkeys_Db_Table_Gateway
|
||||
{
|
||||
return $this->get(self::MAINTENANCE_MODE);
|
||||
}
|
||||
|
||||
public function getVersion()
|
||||
{
|
||||
return $this->get(self::VERSION);
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,6 @@
|
||||
*/
|
||||
|
||||
|
||||
class Site extends Zend_Db_Table_Row_Abstract
|
||||
class Model_Site extends Zend_Db_Table_Row_Abstract
|
||||
{
|
||||
}
|
||||
|
@ -10,20 +10,34 @@
|
||||
*/
|
||||
|
||||
|
||||
class Sites extends Monkeys_Db_Table_Gateway
|
||||
class Model_Sites extends Monkeys_Db_Table_Gateway
|
||||
{
|
||||
protected $_name = 'sites';
|
||||
protected $_primary = 'id';
|
||||
protected $_rowClass = 'Site';
|
||||
protected $_rowClass = 'Model_Site';
|
||||
|
||||
public function deleteForUserSite(User $user, $site)
|
||||
private $_userSites = array();
|
||||
|
||||
public function deleteForUserSite(Users_Model_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)
|
||||
public function getSites(Users_Model_User $user)
|
||||
{
|
||||
if (!isset($this->_userSites[$user->username])) {
|
||||
$select = $this->select()
|
||||
->where('user_id=?', $user->id);
|
||||
|
||||
$this->_userSites[$user->username] = $this->fetchAll($select);
|
||||
}
|
||||
|
||||
return $this->_userSites[$user->username];
|
||||
}
|
||||
|
||||
public function get(Users_Model_User $user, $startIndex, $results)
|
||||
{
|
||||
$select = $this->select()
|
||||
->where('user_id=?', $user->id);
|
||||
@ -35,18 +49,32 @@ class Sites extends Monkeys_Db_Table_Gateway
|
||||
return $this->fetchAll($select);
|
||||
}
|
||||
|
||||
public function getNumSites(User $user)
|
||||
public function getNumSites(Users_Model_User $user)
|
||||
{
|
||||
$sites = $this->get($user, false, false);
|
||||
|
||||
return count($sites);
|
||||
}
|
||||
|
||||
public function getTrusted(User $user)
|
||||
public function isTrusted(Users_Model_User $user, $site)
|
||||
{
|
||||
$select = $this->select()
|
||||
->where('user_id=?', $user->id);
|
||||
foreach ($this->getSites($user) as $userSite) {
|
||||
if ($userSite->site == $site && $userSite->trusted != 'b:0;') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->fetchAll($select);
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isNeverTrusted(Users_Model_User $user, $site)
|
||||
{
|
||||
foreach ($this->getSites($user) as $userSite) {
|
||||
if ($userSite->site == $site && $userSite->trusted == 'b:0;') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
22
modules/default/views/scripts/cid/index.phtml
Normal file
22
modules/default/views/scripts/cid/index.phtml
Normal file
@ -0,0 +1,22 @@
|
||||
<h2><?php echo $this->translate('About Community-id') ?></h2>
|
||||
<div>
|
||||
<label><?php echo $this->translate('Version installed:') ?></label>
|
||||
<?php echo $this->version ?>
|
||||
</div>
|
||||
<div style="margin:20px 0 10px">
|
||||
<label>
|
||||
<?php echo $this->translate('Latest news from Community-ID:') ?>
|
||||
</label>
|
||||
</div>
|
||||
<ul>
|
||||
<?php foreach ($this->news as $item): ?>
|
||||
<li>
|
||||
<div>
|
||||
<a href="<?php echo $item->link ?>"><?= $item->title ?></a>
|
||||
</div>
|
||||
<div class="newsExcerpt">
|
||||
<?php echo $item->content ?>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
@ -6,13 +6,13 @@
|
||||
</head>
|
||||
<body>
|
||||
<h2>An error occurred</h2>
|
||||
<strong><?= $this->message ?></strong>
|
||||
<? if ($this->trace): ?>
|
||||
<strong><?php echo $this->message ?></strong>
|
||||
<?php if ($this->trace): ?>
|
||||
<pre>
|
||||
Stack Trace:
|
||||
<?= $this->trace ?>
|
||||
<?php echo $this->trace ?>
|
||||
</pre>
|
||||
<? endif ?>
|
||||
<?php endif ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
<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') ?>" />
|
||||
<h3><?php echo $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="<?php echo $this->base ?>/feedback/send" class="formGrid">
|
||||
<?php echo $this->form->name ?>
|
||||
<?php echo $this->form->email ?>
|
||||
<?php echo $this->form->feedback ?>
|
||||
<?php echo $this->form->captcha ?>
|
||||
<input type="submit" id="send" value="<?php echo $this->translate('Send') ?>" />
|
||||
<script type="text/javascript">
|
||||
var oButton = new YAHOO.widget.Button("send");
|
||||
</script>
|
||||
|
@ -10,7 +10,7 @@ YAHOO.util.Event.onDOMReady(function () {
|
||||
<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()" />
|
||||
<input type="button" id="clearHistoryBtn" value="<?php echo $this->translate('Clear History') ?>" onclick="COMMID.historyList.clearEntries()" />
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.onDOMReady(function () {
|
||||
var oButton = new YAHOO.widget.Button(
|
||||
|
@ -1,4 +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>
|
||||
<h2 style="text-align:center"><?php echo $this->idUrl ?></h2>
|
||||
</div>
|
||||
|
@ -14,24 +14,43 @@
|
||||
<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>
|
||||
<a href="<?php echo $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): ?>
|
||||
<?php foreach ($this->news as $item): ?>
|
||||
<li>
|
||||
<div>
|
||||
<a href="<?= $item->link['href'] ?>"><?= $item->title ?></a>
|
||||
<a href="<?php echo $this->base . '/news/' . $item->id ?>"><?= $item->title ?></a>
|
||||
</div>
|
||||
<div class="newsExcerpt">
|
||||
<?= $item->content ?>
|
||||
<?php echo $item->excerpt ?>
|
||||
<div>
|
||||
<a class="readMore" href="<?php echo $this->base . '/news/' . $item->id ?>"><?php echo $this->translate('Read More') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<? endforeach ?>
|
||||
<?php endforech ?>
|
||||
<?php if (count($this->news) == 0): ?>
|
||||
<div>
|
||||
<?php echo $this->translate('There are no news articles yet') ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</ul> <!-- FF bug -->
|
||||
<div style="position:relative">
|
||||
<div class="linksTopRight">
|
||||
<?php if (count($this->news) > 0): ?>
|
||||
<a href="<?php echo $this->base ?>/news"><?php echo $this->translate('View All') ?></a>
|
||||
<?php endif ?>
|
||||
<?php if ($this->user->role == Users_Model_User::ROLE_ADMIN): ?>
|
||||
|
|
||||
<a href="<?php echo $this->base ?>/news/edit/add"><?php echo $this->translate('Add New Article') ?></a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="borderFadingLeft">
|
||||
</div>
|
||||
|
@ -14,24 +14,43 @@
|
||||
<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>
|
||||
<a href="<?php echo $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): ?>
|
||||
<?php foreach ($this->news as $item): ?>
|
||||
<li>
|
||||
<div>
|
||||
<a href="<?= $item->link['href'] ?>"><?= $item->title ?></a>
|
||||
<a href="<?php echo $this->base . '/news/' . $item->id ?>"><?= $item->title ?></a>
|
||||
</div>
|
||||
<div class="newsExcerpt">
|
||||
<?= $item->content ?>
|
||||
<?php echo $item->excerpt ?>
|
||||
<div>
|
||||
<a class="readMore" href="<?php echo $this->base . '/news/' . $item->id ?>"><?php echo $this->translate('Read More') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<? endforeach ?>
|
||||
<?php endforeach ?>
|
||||
<?php if (count($this->news) == 0): ?>
|
||||
<div>
|
||||
<?php echo $this->translate('There are no news articles yet') ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</ul> <!-- FF bug -->
|
||||
<div style="position:relative">
|
||||
<div class="linksTopRight">
|
||||
<?php if (count($this->news) > 0): ?>
|
||||
<a href="<?php echo $this->base ?>/news"><?php echo $this->translate('View All') ?></a>
|
||||
<?php endif ?>
|
||||
<?php if ($this->user->role == Users_Model_User::ROLE_ADMIN): ?>
|
||||
|
|
||||
<a href="<?php echo $this->base ?>/news/edit/add"><?php echo $this->translate('Add New Article') ?></a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="borderFadingLeft">
|
||||
</div>
|
||||
|
@ -14,24 +14,41 @@
|
||||
<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>
|
||||
<a href="<?php echo $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>
|
||||
<?php foreach ($this->news as $item): ?>
|
||||
<div>
|
||||
<a href="<?= $item->link['href'] ?>"><?= $item->title ?></a>
|
||||
<a href="<?php echo $this->base . '/news/' . $item->id ?>"><?= $item->title ?></a>
|
||||
</div>
|
||||
<div class="newsExcerpt">
|
||||
<?= $item->content ?>
|
||||
<?php echo $item->excerpt ?>
|
||||
<div>
|
||||
<a class="readMore" href="<?php echo $this->base . '/news/' . $item->id ?>"><?php echo $this->translate('Read More') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<? endforeach ?>
|
||||
<?php endforeach ?>
|
||||
<?php if (count($this->news) == 0): ?>
|
||||
<div>
|
||||
<?php echo $this->translate('There are no news articles yet') ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</ul> <!-- FF bug -->
|
||||
<div style="position:relative">
|
||||
<div class="linksTopRight">
|
||||
<?php if (count($this->news) > 0): ?>
|
||||
<a href="<?php echo $this->base ?>/news"><?php echo $this->translate('View All') ?></a>
|
||||
<?php endif ?>
|
||||
<?php if ($this->user->role == Users_Model_User::ROLE_ADMIN): ?>
|
||||
|
|
||||
<a href="<?php echo $this->base ?>/news/edit/add"><?php echo $this->translate('Add New Article') ?></a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="borderFadingLeft">
|
||||
</div>
|
||||
|
@ -24,24 +24,43 @@
|
||||
<p style="font-weight: bold; text-align:center">
|
||||
Vad väntar du på?<br />
|
||||
Förenkla livet och minska riskerna.<br /><br />
|
||||
<a href="<?= $this->base ?>/users/register">SKAFFA GRATIS OpenID NU</a>
|
||||
<a href="<?php echo $this->base ?>/users/register">SKAFFA GRATIS OpenID NU</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="yui-u">
|
||||
<div id="homeNews">
|
||||
<h3>Senaste nytt</h3>
|
||||
<ul>
|
||||
<? foreach ($this->news as $item): ?>
|
||||
<?php foreach ($this->news as $item): ?>
|
||||
<li>
|
||||
<div>
|
||||
<a href="<?= $item->link['href'] ?>"><?= $item->title ?></a>
|
||||
<a href="<?php echo $this->base . '/news/' . $item->id ?>"><?= $item->title ?></a>
|
||||
</div>
|
||||
<div class="newsExcerpt">
|
||||
<?= $item->content ?>
|
||||
<?php echo $item->excerpt ?>
|
||||
<div>
|
||||
<a class="readMore" href="<?php echo $this->base . '/news/' . $item->id ?>"><?php echo $this->translate('Read More') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<? endforeach ?>
|
||||
<?php endforeach ?>
|
||||
<?php if (count($this->news) == 0): ?>
|
||||
<div>
|
||||
<?php echo $this->translate('There are no news articles yet') ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</ul> <!-- FF bug -->
|
||||
<div style="position:relative">
|
||||
<div class="linksTopRight">
|
||||
<?php if (count($this->news) > 0): ?>
|
||||
<a href="<?php echo $this->base ?>/news"><?php echo $this->translate('View All') ?></a>
|
||||
<?php endif ?>
|
||||
<?php if ($this->user->role == Users_Model_User::ROLE_ADMIN): ?>
|
||||
|
|
||||
<a href="<?php echo $this->base ?>/news/edit/add"><?php echo $this->translate('Add New Article') ?></a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="borderFadingLeft">
|
||||
</div>
|
||||
|
@ -6,49 +6,33 @@
|
||||
}
|
||||
</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">
|
||||
<em><?php echo $this->translate('This message will be sent to all registered Community-ID users') ?></em>
|
||||
<form id="messageUsersForm" name="messageUsersForm" method="post" action="<?php echo $this->base ?>/messageusers/send" class="formGrid">
|
||||
<input type="hidden" name="messageType" value="rich" />
|
||||
<dl class="shortLabelsForm">
|
||||
<?= $this->messageUsersForm->subject ?>
|
||||
<?= $this->messageUsersForm->cc ?>
|
||||
</dl>
|
||||
<?php echo $this->messageUsersForm->subject ?>
|
||||
<?php echo $this->messageUsersForm->cc ?>
|
||||
<div id="textareasWrapper">
|
||||
<div id="linkSwitchToPlain">
|
||||
<a href="#" onclick="COMMID.messageUsers.switchToPlainText()"><?= $this->translate('switch to Plain-Text') ?></a>
|
||||
<a href="#" onclick="COMMID.messageUsers.switchToPlainText()"><?php echo $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>
|
||||
<a href="#" onclick="COMMID.messageUsers.switchToRichText()"><?php echo $this->translate('switch to Rich-Text (HTML)') ?></a>
|
||||
</div>
|
||||
<br />
|
||||
<div id="bodyPlainWrapper">
|
||||
<?php echo $this->messageUsersForm->bodyPlain ?>
|
||||
</div>
|
||||
<div id="bodyHTMLWrapper">
|
||||
<?php echo $this->messageUsersForm->bodyHTML ?>
|
||||
</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') ?>" />
|
||||
<input type="submit" id="send" value="<?php echo $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;
|
||||
}
|
||||
);
|
||||
});
|
||||
YAHOO.util.Event.onDOMReady(function() {
|
||||
$("messageUsersForm").onsubmit = COMMID.messageUsers.send;
|
||||
});
|
||||
</script>
|
||||
|
@ -1,10 +1,16 @@
|
||||
<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>
|
||||
<form action="authenticate<?php echo $this->queryString ?>" method="post" class="formGrid">
|
||||
<?php echo $this->form->openIdIdentity ?>
|
||||
<?php echo $this->form->password ?>
|
||||
<?php if ($this->useCaptcha): ?>
|
||||
<?php echo $this->form->captcha ?>
|
||||
<?php endif ?>
|
||||
<div class="yui-gf">
|
||||
<div class="yui-u first">
|
||||
<input type="submit" id="login" value="<?php echo $this->translate('Login') ?>" />
|
||||
<script type="text/javascript">
|
||||
var oButton = new YAHOO.widget.Button("login");
|
||||
</script>
|
||||
</div>
|
||||
<div class="yui-u"> </div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -1,31 +1,31 @@
|
||||
<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>') ?>
|
||||
<?php echo $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">
|
||||
<form method="post" action="proceed<?php echo $this->queryString ?>" class="formGrid">
|
||||
<input type="hidden" name="action" value="proceed">
|
||||
<? if ($this->fields): ?>
|
||||
<?php 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.') ?>
|
||||
<?php echo $this->translate('It also requests this additional information about you:') ?><br /><br />
|
||||
<?php echo $this->translate('Fields are automatically filled according to the personal info stored in your community-id account.') ?><br />
|
||||
<?php echo $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',
|
||||
<?php foreach ($this->fields as $field): ?>
|
||||
<?php echo $field ?>
|
||||
<?php endforeach ?>
|
||||
<?php if ($this->policyUrl): ?>
|
||||
<?php echo $this->translate('The private policy can be found at %s',
|
||||
'<a href="'.$this->policyUrl.'">'.$this->policyUrl.'</a>'); ?><br /><br />
|
||||
<? endif ?>
|
||||
<? endif ?>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
<div style="margin-top:20px">
|
||||
<input type="checkbox" name="forever" style="top:0" /> <?= $this->translate('Forever') ?>
|
||||
<input type="checkbox" name="forever" style="top:0" /> <?php echo $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') ?>" />
|
||||
<input type="submit" id="allow" name="allow" value="<?php echo $this->translate('Allow') ?>" />
|
||||
<input type="submit" id="deny" name="deny" value="<?php echo $this->translate('Deny') ?>" />
|
||||
<script type="text/javascript">
|
||||
var oButton1 = new YAHOO.widget.Button("allow");
|
||||
var oButton2 = new YAHOO.widget.Button("deny");
|
||||
|
@ -1,4 +1,4 @@
|
||||
<h2><?= $this->translate('Privacy Policy') ?></h2>
|
||||
<h2><?php echo $this->translate('Privacy Policy') ?></h2>
|
||||
<div>
|
||||
<?= $this->privacyPolicy ?>
|
||||
<?php echo $this->privacyPolicy ?>
|
||||
</div>
|
||||
|
@ -12,13 +12,13 @@ YAHOO.util.Event.onDOMReady(function () {
|
||||
<div id="paging"></div>
|
||||
<div id="dt"></div>
|
||||
<div id="fieldsDialog">
|
||||
<div class="hd"><?= $this->translate('Information Exchanged') ?></div>
|
||||
<div class="hd"><?php echo $this->translate('Information Exchanged') ?></div>
|
||||
<div class="bd">
|
||||
<?= $this->translate('Information exchanged with:') ?><br />
|
||||
<?php echo $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()" />
|
||||
<input type="button" id="closeDialog" value="<?php echo $this->translate('OK') ?>" onclick="COMMID.sitesList.closeDialog()" />
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.onDOMReady(function () {
|
||||
var oButton = new YAHOO.widget.Button(
|
||||
|
Reference in New Issue
Block a user