コード例 #1
0
 public function create($userName, $name, $email)
 {
     $accountFactory = new AccountFactory();
     $accountObject = $accountFactory->make('Member');
     $this->subscribeObservers($accountObject);
     $accountObject->create($userName, $name, $email);
 }
コード例 #2
0
 public function testWhitelist()
 {
     $factory = new AccountFactory();
     $this->assertSame(BankNames::BANK_PLUSGIRO, $factory->createAccount('58056201')->getBankName(), 'When plusgiro is ENABLED 58056201 is considerad a valid plusgiro account');
     $factory->whitelistFormats([BankNames::FORMAT_BANKGIRO]);
     $this->assertSame(BankNames::BANK_BANKGIRO, $factory->createAccount('58056201')->getBankName(), 'When plusgiro is DISABLED 58056201 is considerad a valid bankgiro account');
 }
コード例 #3
0
 public function create($userName, $name, $email)
 {
     $accountFactory = new AccountFactory();
     $accountObject = $accountFactory->make('Performer');
     $this->subscribeObservers($accountObject);
     // Temporary we don't want to send remote mail to yahoo users about creation:
     if (stristr($email, '@yahoo') !== FALSE) {
         $this->unSubscribeObserver($accountObject);
     }
     $accountObject->create($userName, $name, $email);
 }
コード例 #4
0
ファイル: account_test.php プロジェクト: reillo/ninjawars
 public function testAccountCanSaveNewOauthIdAfterHavingItAdded()
 {
     $account = AccountFactory::make($this->testAccountId);
     $oauth_id = 88888888888888.0;
     $account->setOauthId($oauth_id, 'facebook');
     AccountFactory::save($account);
     $account_dupe = AccountFactory::make($this->testAccountId);
     $this->assertEquals($oauth_id, $account_dupe->getOauthId());
 }
コード例 #5
0
ファイル: AccountFactory.php プロジェクト: nyashkn/pesaPi
 static function factoryAll()
 {
     $db = Database::instantiate(Database::TYPE_READ);
     $query = AccountFactory::SELECTLIST . "\n\t\t\t\t\t\t\tFROM  pesapi_account ";
     $tempArray = array();
     if ($result = $db->query($query)) {
         while ($foo = $db->fetchObject($result)) {
             $tempArray[] = AccountFactory::createEntry($foo->type, $foo->id, $foo);
         }
         $db->freeResult($result);
     }
     return $tempArray;
 }
コード例 #6
0
ファイル: view.html.php プロジェクト: ErickLopez76/offiria
 public function modInvitationList()
 {
     $usersInvite = AccountFactory::getModel('usersInvite');
     $result = $usersInvite->getList(array('status' => AccountTableUsersInvite::PENDING), '10');
     $html = '<ul>';
     if (!empty($result)) {
         foreach ($result as $record) {
             $date = JXDate::formatDate($record->last_invite_date);
             $html .= '<li>' . $record->invite_email . ' invited on ' . $date . '</li>';
         }
     }
     $html .= '</ul>';
     return $html;
 }
コード例 #7
0
ファイル: oauth.php プロジェクト: ErickLopez76/offiria
 /**
  * Open authorize window
  *	 Authorise the app to access user's resource
  */
 public function authenticate()
 {
     if ($_POST) {
         $approved = JRequest::getVar('app_true');
         $notApproved = JRequest::getVar('app_false');
         $model = AccountFactory::getModel('token');
         $mainframe = JFactory::getApplication();
         if ($approved) {
             $user = JFactory::getUser();
             if ($model->generateToken($user->id)) {
                 $mainframe->redirect(JRoute::_('index.php?option=com_account&view=account'), JText::_('com_account_ACTION_APPROVED_PERFORMED'));
             } else {
                 $mainframe->redirect(JRoute::_('index.php?option=com_account&view=account'), JText::_('com_account_ACTION_ERROR'), 'error');
             }
         } else {
             if ($notApproved) {
                 /* Action for cancel */
                 echo 'Canceled';
             }
         }
     }
     parent::display();
 }
コード例 #8
0
ファイル: test.php プロジェクト: Blondas/test3_CurrentAccount
<?php

include 'AccountFactory.php';
include 'AccountManager.php';
$accountManager = new AccountManager();
$account = AccountFactory::getAccount($accountManager, AccountFactory::ACCOUNT_TYPE_CURRENT);
$account->depositFounds(200);
$account->displayBalance();
$account->getOverdraft()->appliedAgreedOverdraft(500);
$account->displayBalance();
$account->withdrawFunds(300);
$account->displayBalance();
コード例 #9
0
ファイル: PlusgiroFactory.php プロジェクト: byrokrat/banking
 /**
  * Create plusgiro account object using number
  *
  * @param  string $number
  * @return PlusGiro
  * @throws Exception\UnableToCreateAccountException If unable to create
  */
 public function createAccount($number)
 {
     return parent::createAccount($number);
 }
コード例 #10
0
ファイル: Account.php プロジェクト: jatelohimself/pesaPi
 public static function createNew($type, $identifier)
 {
     $type = (int) $type;
     if ($type > 0 and $identifier != "") {
         $db = Database::instantiate(Database::TYPE_WRITE);
         $newSettings = array("PUSH_IN_URL" => "", "PUSH_IN_SECRET" => "", "PUSH_OUT_URL" => "", "PUSH_OUT_SECRET" => "", "PUSH_NEUTRAL_URL" => "", "PUSH_NEUTRAL_SECRET" => "", "SYNC_SECRET" => Utility::generatePassword(8));
         $settings = serialize($newSettings);
         $query = "INSERT INTO   pesapi_account(\n                              type,\n                              name,\n                              identifier,\n                              push_in,\n                              push_out,\n                              push_neutral,\n                              settings)\n                VALUES(\n                              '{$type}',\n                              '',\n                              '" . $db->dbIn($identifier) . "',\n                              0,\n                              0,\n                              0,\n                              '" . $db->dbIn($settings) . "')";
         if ($db->query($query)) {
             return AccountFactory::createEntry($type, $db->insertId());
         }
     }
     return null;
 }
コード例 #11
0
ファイル: index.php プロジェクト: ErickLopez76/offiria
// If page title is set, add it here. BUT, don't show it
// if it is the same as site title (which mean, the title is not set)
$docTitle = $document->getTitle();
if (!empty($docTitle) && $docTitle != $config->sitename) {
    echo '<h1>' . StreamTemplate::escape($docTitle) . '</h1>';
}
?>
					<jdoc:include type="component" />
				
					<jdoc:include type="modules" name="component_bottom" style="default"/>
				</div>
			
				<div id="sidebar-right" class="grid_3">
					<?php 
// Add guest invite right module
$accountView = AccountFactory::getView('invite');
JXModule::addBuffer('right', $accountView->modMemberInvite());
$buffer =& JXModule::getBuffer('right');
foreach ($buffer as $buff) {
    echo $buff;
}
?>
					<?php 
/* if($option == 'com_stream' && $view == 'company') { ?>
			<img src="<?php echo JURI::root().'components/com_stream/assets/images/hot_topics.png'; ?>" />
			<?php } */
?>

				</div>
			</div>
		</div><!-- #eContent -->
コード例 #12
0
ファイル: invite.php プロジェクト: ErickLopez76/offiria
 public function getPendingEmailCount($all = false)
 {
     $inviteModel = AccountFactory::getModel('usersinvite');
     $userTbl = JTable::getInstance('AccountUser', 'AccountTable');
     $inviteTbl = JTable::getInstance('usersinvite', 'AccountTable');
     if ($all) {
         $filter = array('status' => AccountTableUsersInvite::PENDING);
     } else {
         $filter = array('status' => AccountTableUsersInvite::PENDING, 'days_ahead' => '3');
     }
     $num = $inviteModel->getTotal($filter);
     return $num;
 }