本文整理汇总了PHP中Account类的典型用法代码示例。如果您正苦于以下问题:PHP Account类的具体用法?PHP Account怎么用?PHP Account使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Account类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: doLogin
function doLogin($referer_in, $post)
{
extract($post);
if ($submit_login) {
if (!recaptchaCheck()) {
return 0;
}
$database = connectToDatabase();
$account = new Account($username);
if ($account->checkPassword($password)) {
session_name($username);
$_SESSION['username'] = $username;
$_SESSION['id'] = $account->getDatabaseID();
if ($referer) {
doRedirect($referer);
} else {
renderError("Cannot redirect you to the proper place. Please press the back button and try again.");
return 0;
}
} else {
renderError("Your password is incorrect. Please try again");
return 0;
}
} else {
renderError("You need to login to do that.");
displayLoginForm($referer_in);
return 0;
}
}
开发者ID:fbrier,项目名称:open-configurator,代码行数:29,代码来源:login.php
示例2: overwriteRead
public function overwriteRead($return)
{
$objs = $return['objs'];
foreach ($objs as $obj) {
if (isset($obj->news_postdate)) {
$obj->news_postdate = date("d-m-Y", strtotime($obj->news_postdate));
}
if (isset($obj->news_updatedate)) {
$obj->news_updatedate = date("d-m-Y", strtotime($obj->news_updatedate));
}
if (isset($obj->news_validity_begin)) {
$obj->news_validity_begin = date("d-m-Y", strtotime($obj->news_validity_begin));
}
if (isset($obj->news_validity_end)) {
$obj->news_validity_end = date("d-m-Y", strtotime($obj->news_validity_end));
}
if (isset($obj->news_author)) {
$acc = new Account();
$acc->getByID($obj->news_author);
$obj->news_author = $acc->admin_nama_depan;
}
if (isset($obj->news_channel_id)) {
$acc = new NewsChannel();
$acc->getByID($obj->news_channel_id);
$obj->news_channel_id = $acc->channel_name;
}
}
//pr($return);
return $return;
}
开发者ID:CapsuleCorpIndonesia,项目名称:elang-combo,代码行数:30,代码来源:ModelPortalContent.php
示例3: __construct
/**
* @param Identifier $memberId
* @param string $name
* @param Email $email
* @param Account $account
*/
public function __construct(Identifier $memberId, $name, Email $email, Account $account)
{
$this->memberId = $memberId;
$this->name = $name;
$this->email = $email;
$this->account = $account->information();
}
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:13,代码来源:MemberInformation.php
示例4: searchResults
public function searchResults($search)
{
$accounts = new Accounts();
$accounts->userID = $_SESSION['userID'];
$_SESSION['accounts'] = $accounts->getAccounts();
$_SESSION['accountID'] = $search['accountID'];
$this->setAccountSelected($_SESSION['accountID']);
$account = new Account();
$account->accountID = $_SESSION['accountID'];
$account->getAccount();
$_SESSION['searchDetails'] = $search['searchDetails'];
$_SESSION['fromAmount'] = $search['fromAmount'];
$_SESSION['toAmount'] = $search['toAmount'];
if (strlen($search['toDate']) != 0) {
$_SESSION['toDate'] = $search['toDate'];
} else {
$_SESSION['toDate'] = date('Y-m-d');
}
if (strlen($search['fromDate']) != 0) {
$_SESSION['fromDate'] = $search['fromDate'];
} else {
$_SESSION['fromDate'] = date("Y-m-d", strtotime("-1 months"));
}
$_SESSION['period'] = date('d/m/Y', strtotime($_SESSION['fromDate'])) . ' to ' . date('d/m/Y', strtotime($_SESSION['toDate']));
$transactions = new Transactions();
$transactions->accountID = $_SESSION['accountID'];
$arr = array('openBalance' => $account->openBalance);
$_SESSION['history'] = $transactions->getTransactions($arr);
$_SESSION['found'] = $transactions->countTransactions($arr);
$_SESSION['historyDebit'] = $transactions->getDebits($arr);
$_SESSION['historyCredit'] = $transactions->getCredits($arr);
$_SESSION['historyFee'] = $transactions->getFees($arr);
$_SESSION['historyNet'] = $transactions->getNet($arr);
}
开发者ID:s3444261,项目名称:assignment2,代码行数:34,代码来源:History.php
示例5: testRequiredAttributesAreMissingFromLayout
public function testRequiredAttributesAreMissingFromLayout()
{
$super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
$account = AccountTestHelper::createAccountByNameForOwner('aTestAccount', $super);
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/default/create');
$this->assertNotContains('There are required fields missing from the following layout', $content);
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/default/list');
$this->assertNotContains('There are required fields missing from the following layout', $content);
$this->setGetArray(array('id' => $account->id));
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/default/edit');
$this->assertNotContains('There are required fields missing from the following layout', $content);
//Now create an attribute that is required.
$this->createTextCustomFieldByModule('AccountsModule', 'text');
$content = $this->runControllerWithExitExceptionAndGetContent('accounts/default/create');
$this->assertContains('There are required fields missing from the following layout', $content);
$content = $this->runControllerWithNoExceptionsAndGetContent('accounts/default/list');
$this->assertNotContains('There are required fields missing from the following layout', $content);
$this->setGetArray(array('id' => $account->id));
$content = $this->runControllerWithExitExceptionAndGetContent('accounts/default/edit');
$this->assertContains('There are required fields missing from the following layout', $content);
//Remove the new field.
$modelAttributesAdapterClassName = TextAttributeForm::getModelAttributeAdapterNameForSavingAttributeFormData();
$adapter = new $modelAttributesAdapterClassName(new Account());
$adapter->removeAttributeMetadata('text');
RequiredAttributesValidViewUtil::resolveToRemoveAttributeAsMissingRequiredAttribute('Account', 'text');
$account = new Account();
$this->assertFalse($account->isAttribute('text'));
unset($account);
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:29,代码来源:RequiredAttributesViewValidityWalkthroughTest.php
示例6: save
/**
* Logs in the user using the given username and password in the model.
* @return boolean whether login is successful
*/
public function save()
{
$user = new Users();
$user->setAttributes($this->attributes);
$user->setAttribute("password", BaseTool::ENPWD($this->password));
if ($user->validate() && $user->save()) {
$accountarray = array('user_id' => Yii::app()->db->getLastInsertID(), 'total' => 0, 'use_money' => 0, 'no_use_money' => 0, 'newworth' => 0);
$newAccount = new Account();
$newAccount->setAttributes($accountarray);
$newAccount->save();
//发送邮件
$activecode = BaseTool::getActiveMailCode($this->username);
$message = MailTemplet::getActiveEmail($this->username, $activecode);
$mail = Yii::app()->Smtpmail;
$mail->SetFrom(Yii::app()->params['adminEmail']);
$mail->Subject = "好帮贷测试邮件";
$mail->MsgHTML($message);
$mail->AddAddress($this->email);
if ($mail->Send()) {
$user->updateAll(array("regtaken" => $activecode, "regativetime" => time() + 60 * 60), "username=:username", array(":username" => $this->username));
}
Yii::import("application.models.form.LoginForm", true);
$loginform = new LoginForm();
$loginarray = array('rememberMe' => false, 'username' => $this->username, 'password' => $this->password);
$loginform->setAttributes($loginarray);
if ($loginform->validate() && $loginform->login()) {
}
return true;
} else {
$usererror = $user->errors;
$this->addError("username", current(current($usererror)));
return false;
}
}
开发者ID:bfyang5130,项目名称:zzl,代码行数:38,代码来源:RegeditForm.php
示例7: init
public function init()
{
$account = new Account();
$account->accountID = $_SESSION['payAccountID'];
$account->getAccount();
$_SESSION['payAccount'] = $account->accountName;
}
开发者ID:s3444261,项目名称:assignment2,代码行数:7,代码来源:Paymentconf.php
示例8: create
public function create()
{
$user = Confide::user();
//throw new Exception($user);
if (Request::isMethod('GET')) {
$patient = Patient::find($user->id);
return View::make('home/patient/create', compact('user', 'patient'));
} elseif (Request::isMethod('POST')) {
// Create a new Appointment with the given data
$user = Confide::user();
$user->fill(Input::all());
$user->save();
// If patient already exists in system
$patient = Patient::find($user->id);
if ($patient != null) {
// Retreive Patient
} else {
// Create a new account for the Patient
$account = new Account();
$account->patient_id = $user->id;
$account->save();
// Create a new Patient
$patient = new Patient();
$patient->fill(Input::all());
//$patient->dob = new Date();
$patient->user_id = $user->id;
$patient->save();
}
return Redirect::route('home.index');
}
}
开发者ID:carlosqueiroz,项目名称:medical-management-system,代码行数:31,代码来源:PatientController.php
示例9: query
public static function query($q)
{
$db = getDatabase();
try {
$stmt = $db->prepare($q);
$stmt->execute();
} catch (PDOException $ex) {
Utils::HandlePDOException($ex);
}
$len = $stmt->rowCount();
if ($len <= 0) {
throw new Exception("no item");
} else {
if ($len == 1) {
$temp = new Account();
$temp->initWithVar($stmt->fetch());
return $temp;
} else {
$result = array();
foreach ($stmt->fetchAll() as $thread) {
$temp = new Account();
$temp->initWithVar($thread);
array_push($result, $temp);
}
return $result;
}
}
}
开发者ID:plainbanana,项目名称:eicforum,代码行数:28,代码来源:account.php
示例10: setUp
public function setUp()
{
SugarTestHelper::setUp('beanFiles');
SugarTestHelper::setUp('beanList');
SugarTestHelper::setUp('current_user');
$unid = uniqid();
$time = date('Y-m-d H:i:s');
$contact = new Contact();
$contact->id = 'c_' . $unid;
$contact->first_name = 'testfirst';
$contact->last_name = 'testlast';
$contact->new_with_id = true;
$contact->disable_custom_fields = true;
$contact->save();
$this->contact = $contact;
$account = new Account();
$account->id = 'a_' . $unid;
$account->first_name = 'testfirst';
$account->last_name = 'testlast';
$account->assigned_user_id = 'SugarUser';
$account->new_with_id = true;
$account->disable_custom_fields = true;
$account->save();
$this->account = $account;
$ac_id = 'ac_' . $unid;
$this->ac_id = $ac_id;
//Accounts to Contacts
$GLOBALS['db']->query("INSERT INTO accounts_contacts (id , contact_id, account_id, date_modified, deleted) values ('{$ac_id}', '{$contact->id}', '{$account->id}', '{$time}', 0)");
$_REQUEST['relate_id'] = $this->contact->id;
$_REQUEST['relate_to'] = 'projects_contacts';
}
开发者ID:newLoki,项目名称:sugarcrm_dev,代码行数:31,代码来源:Bug37123Test.php
示例11: setUp
/**
* Create test user
*
*/
public function setUp()
{
$this->markTestIncomplete('Skipping for now while investigating');
//setup test portal user
$this->_setupTestUser();
$this->_soapClient = new nusoapclient($GLOBALS['sugar_config']['site_url'] . '/soap.php', false, false, false, false, false, 600, 600);
$this->_login();
//setup test account
$account = new Account();
$account->name = 'test account for bug 39855';
$account->assigned_user_id = 'SugarUser';
$account->save();
$this->_acc = $account;
//setup test cases
$case1 = new aCase();
$case1->name = 'test case for bug 39855 ASDF';
$case1->account_id = $this->_acc->id;
$case1->status = 'New';
$case1->save();
$this->_case1 = $case1;
$case2 = new aCase();
//$account->id = 'a_'.$unid;
$case2->name = 'test case for bug 39855 QWER';
$case2->account_id = $this->_acc->id;
$case2->status = 'Rejected';
$case2->save();
$this->_case2 = $case2;
}
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:32,代码来源:Bug39855Test.php
示例12: setUp
public function setUp()
{
global $current_user, $currentModule;
global $beanList;
require 'include/modules.php';
$current_user = SugarTestUserUtilities::createAnonymousUser();
$unid = uniqid();
$time = date('Y-m-d H:i:s');
$contact = new Contact();
$contact->id = 'c_' . $unid;
$contact->first_name = 'testfirst';
$contact->last_name = 'testlast';
$contact->new_with_id = true;
$contact->disable_custom_fields = true;
$contact->save();
$this->contact = $contact;
$account = new Account();
$account->id = 'a_' . $unid;
$account->first_name = 'testfirst';
$account->last_name = 'testlast';
$account->assigned_user_id = 'SugarUser';
$account->new_with_id = true;
$account->disable_custom_fields = true;
$account->save();
$this->account = $account;
$ac_id = 'ac_' . $unid;
$this->ac_id = $ac_id;
//Accounts to Contacts
$GLOBALS['db']->query("INSERT INTO accounts_contacts (id , contact_id, account_id, date_modified, deleted) values ('{$ac_id}', '{$contact->id}', '{$account->id}', '{$time}', 0)");
$_REQUEST['relate_id'] = $this->contact->id;
$_REQUEST['relate_to'] = 'projects_contacts';
}
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:32,代码来源:Bug37123Test.php
示例13: execute
function execute(&$bean)
{
if ($bean->sales_stage == "completed") {
$realty_list = $bean->get_linked_beans("realty_opportunities", "Realty");
if (!empty($bean->contact_id)) {
$contact = new Contact();
$contact->retrieve($bean->contact_id);
foreach ($realty_list as $realty) {
if ($realty->operation == 'rent') {
$contact->load_relationship("realty_contacts_rent");
$contact->realty_contacts_rent->add($realty->id);
} elseif ($realty->operation == 'buying') {
$contact->load_relationship("realty_contacts_buying");
$contact->realty_contacts_buying->add($realty->id);
}
}
}
if (!empty($bean->account_id)) {
$account = new Account();
$account->retrieve($bean->account_id);
foreach ($realty_list as $realty) {
if ($realty->operation == 'rent') {
$account->load_relationship("realty_accounts_rent");
$account->realty_accounts_rent->add($realty->id);
} elseif ($realty->operation == 'buying') {
$account->load_relationship("realty_accounts_buying");
$account->realty_accounts_buying->add($realty->id);
}
}
}
}
}
开发者ID:omusico,项目名称:sugar_work,代码行数:32,代码来源:after_save.php
示例14: writeDefaultConfig
public function writeDefaultConfig($config)
{
$account = new Account();
$account->name = $config['name'];
$account->workingdays = '31';
$account->type = 'unlimited';
$account->save();
// add timeitem types
$tit = new TimeItemType();
$tit->account_id = $account->id;
$tit->name = 'DEV';
$tit->save();
$tit = new TimeItemType();
$tit->account_id = $account->id;
$tit->name = 'ADMIN';
$tit->default_item = true;
$tit->save();
$admin_settings = new Setting();
$admin_settings->theme = 'green';
$admin = new User();
$admin->Account = $account;
$admin->administrator = true;
$admin->username = $config['username'];
$admin->password = md5($config['password']);
$admin->Setting = $admin_settings;
$admin->save();
return $account->id;
}
开发者ID:newZinc,项目名称:timehive,代码行数:28,代码来源:AccountConfigWriter.class.php
示例15: setUp
public function setUp()
{
global $current_user, $currentModule;
$mod_strings = return_module_language($GLOBALS['current_language'], "Contacts");
$current_user = SugarTestUserUtilities::createAnonymousUser();
$unid = uniqid();
$time = date('Y-m-d H:i:s');
$contact = new Contact();
$contact->id = 'c_' . $unid;
$contact->first_name = 'testfirst';
$contact->last_name = 'testlast';
$contact->new_with_id = true;
$contact->disable_custom_fields = true;
$contact->save();
$this->c = $contact;
$account = new Account();
$account->id = 'a_' . $unid;
$account->first_name = 'testfirst';
$account->last_name = 'testlast';
$account->assigned_user_id = 'SugarUser';
$account->new_with_id = true;
$account->disable_custom_fields = true;
$account->save();
$this->a = $account;
$ac_id = 'ac_' . $unid;
$this->ac_id = $ac_id;
$GLOBALS['db']->query("insert into accounts_contacts (id , contact_id, account_id, date_modified, deleted) values ('{$ac_id}', '{$contact->id}', '{$account->id}', '{$time}', 0)");
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:28,代码来源:Bug15255Test.php
示例16: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
$account = new Account();
///$account->setDomain(Input::get('domain'));
$account->setNit(Input::get('nit'));
$account->setName(Input::get('name'));
$account->setEmail(Input::get('email'));
// return $account->getErrorMessage();
if ($account->Guardar()) {
//redireccionar con el mensaje a la siguiente vista
Session::flash('mensaje', $account->getErrorMessage());
$direccion = "http://cascada.ipx";
//enviando correo de bienvenida
global $correo;
$correo = $account->getEmail();
// return Response::json($correo);
Mail::send('emails.bienvenida', array('direccion' => $direccion, 'name' => $account->getName(), 'nit' => $account->getNit()), function ($message) {
global $correo;
$message->to($correo, '')->subject('EMIZOR');
});
//
// $direccion = "/crear/sucursal";
return Redirect::to($direccion);
}
Session::flash('error', $account->getErrorMessage());
return Redirect::to('crear');
}
开发者ID:Vrian7ipx,项目名称:repocas,代码行数:32,代码来源:IpxController.php
示例17: actionRandomOperation
public function actionRandomOperation()
{
$rec = new Account();
$rec->amount = rand(-1000, 1000);
$rec->save();
echo "OK";
}
开发者ID:moohwaan,项目名称:yii-application-cookbook-2nd-edition-code,代码行数:7,代码来源:DashboardController.php
示例18: display
function display($defines)
{
global $app_strings;
global $currentModule;
$title = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_TITLE'];
$accesskey = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_KEY'];
$value = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_LABEL'];
$this->module = 'Emails';
$to_addrs = '';
$additionalFormFields = array();
$additionalFormFields['type'] = 'out';
// cn: bug 5727 - must override the parents' parent for contacts (which could be an Account)
$additionalFormFields['parent_type'] = $defines['focus']->module_dir;
$additionalFormFields['parent_id'] = $defines['focus']->id;
$additionalFormFields['parent_name'] = $defines['focus']->name;
if (isset($defines['focus']->email1)) {
$to_addrs = $defines['focus']->email1;
} elseif ($defines['focus']->object_name == 'Case') {
require_once 'modules/Accounts/Account.php';
$acct = new Account();
$acct->retrieve($defines['focus']->account_id);
$to_addrs = $acct->email1;
}
if (!empty($to_addrs)) {
$additionalFormFields['to_email_addrs'] = $to_addrs;
}
if (ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)) {
$button = "<input title='{$title}' class='button' type='button' name='button' value=' {$value} '/>\n";
return $button;
}
$button = $this->_get_form($defines, $additionalFormFields);
$button .= "<input title='{$title}' accesskey='{$accesskey}' class='button' type='submit' name='button' value=' {$value} '/>\n";
$button .= "</form>";
return $button;
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:35,代码来源:SugarWidgetSubPanelTopComposeEmailButton.php
示例19: signin
public function signin() {
$email = $this->f3->get('POST.email');
$password = $this->f3->get('POST.password');
$v = new Valitron\Validator(array('Email' => $email, 'Password' => $password));
$v->rule('required', ['Email', 'Password']);
$v->rule('email', 'Email');
if ($v->validate()) {
$account = new Account($this->db);
$pwd = md5($password);
$acc = $account->select("*", "email='$email' and password='$pwd'");
if ($acc) {
$this->f3->set('SESSION.acc', $acc);
$acc = $acc[0];
$acc['lastlogin'] = date('Y-m-d H:i:s');
$account->update($acc,'id='.$acc['id']);
$this->f3->reroute('/dashboard');
} else {
$this->f3->set('email', $email);
$this->f3->set('errors', array(array('Login fail, wrong username or password')));
echo Template::instance()->render('index.html');
}
} else {
$this->f3->set('email', $email);
$this->f3->set('errors', $v->errors());
echo Template::instance()->render('index.html');
}
}
开发者ID:hendrosteven,项目名称:f3-adminlte,代码行数:29,代码来源:AccountController.php
示例20: addAccount
public function addAccount($username, $password, $firstname)
{
// Loop through the current accounts to see if the username already exists
// If the username does not exist, we will push the new account in to the array & return true
// Else, return false
$accountExists = false;
foreach ($this::$data as $account) {
if ($account->getUsername() == $username) {
$accountExists = true;
break;
}
}
if ($accountExists) {
return false;
} else {
$account = new Account();
$account->setUsername($username);
$account->setPassword($password);
$account->setFirstname($firstname);
echo "adding to data..";
array_push(InMemoryDatabase::$data, $account);
var_dump($this::$data);
return true;
}
}
开发者ID:xcgpseud,项目名称:chat,代码行数:25,代码来源:InMemoryDatabase.php
注:本文中的Account类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论