• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Credentials类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Credentials的典型用法代码示例。如果您正苦于以下问题:PHP Credentials类的具体用法?PHP Credentials怎么用?PHP Credentials使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Credentials类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: testCredentials

 public function testCredentials()
 {
     $credentials = new Credentials(self::MERCHANT, self::PRIVATE_KEY, new Md5Algorithm(), self::ENCRYPTION_PROTOCOL);
     $this->assertEquals(self::MERCHANT, $credentials->getMerchantPosId());
     $this->assertEquals(self::PRIVATE_KEY, $credentials->getPrivateKey());
     $this->assertEquals(self::ENCRYPTION_PROTOCOL, $credentials->getEncryptionProtocols());
     $this->assertInstanceOf('\\Team3\\PayU\\SignatureCalculator\\Encoder\\Algorithms\\AlgorithmInterface', $credentials->getSignatureAlgorithm());
 }
开发者ID:krzysztof-gzocha,项目名称:payu,代码行数:8,代码来源:CredentialsTest.php


示例2: tryLogin

 public function tryLogin(Credentials $userCredentials, UserArray $users)
 {
     //First check to make sure the user is not already logged in (this is also checked in controller, but I prefer to check in all places to minimize errors)
     if (!$this->isUserLoggedIn()) {
         //If input matches any saved user, return true (successful login attempt) and save in session variable as 'logged in'
         if ($users->getUserByName($userCredentials->getUserName()) != null && password_verify($userCredentials->getUserPassword(), $users->getUserByName($userCredentials->getUserName())->getPassword())) {
             $_SESSION['LoggedIn'] = $userCredentials->getUserName();
             return true;
         }
     }
     //In all other cases, return false
     return false;
 }
开发者ID:jc222fi,项目名称:PHP-assignment-2,代码行数:13,代码来源:LoginModel.php


示例3: testHstore

 /**
  * Install hstore
  * /usr/share/postgresql/contrib # cat hstore.sql | psql -U pgsql -d onphp
  **/
 public function testHstore()
 {
     foreach (DBTestPool::me()->getPool() as $connector => $db) {
         DBPool::me()->setDefault($db);
         $properties = array('age' => '23', 'weight' => 80, 'comment' => null);
         $user = TestUser::create()->setCity($moscow = TestCity::create()->setName('Moscow'))->setCredentials(Credentials::create()->setNickname('fake')->setPassword(sha1('passwd')))->setLastLogin(Timestamp::create(time()))->setRegistered(Timestamp::create(time())->modify('-1 day'))->setProperties(Hstore::make($properties));
         $moscow = TestCity::dao()->add($moscow);
         $user = TestUser::dao()->add($user);
         Cache::me()->clean();
         TestUser::dao()->dropIdentityMap();
         $user = TestUser::dao()->getById('1');
         $this->assertInstanceOf('Hstore', $user->getProperties());
         $this->assertEquals($properties, $user->getProperties()->getList());
         $form = TestUser::proto()->makeForm();
         $form->get('properties')->setFormMapping(array(Primitive::string('age'), Primitive::integer('weight'), Primitive::string('comment')));
         $form->import(array('id' => $user->getId()));
         $this->assertNotNull($form->getValue('id'));
         $object = $user;
         FormUtils::object2form($object, $form);
         $this->assertInstanceOf('Hstore', $form->getValue('properties'));
         $this->assertEquals(array_filter($properties), $form->getValue('properties')->getList());
         $subform = $form->get('properties')->getInnerForm();
         $this->assertEquals($subform->getValue('age'), '23');
         $this->assertEquals($subform->getValue('weight'), 80);
         $this->assertNull($subform->getValue('comment'));
         $user = new TestUser();
         FormUtils::form2object($form, $user, false);
         $this->assertEquals($user->getProperties()->getList(), array_filter($properties));
     }
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:34,代码来源:HstoreDBTest.class.php


示例4: __construct

 /**
  * Constructs a Credentials object for Users (making requests on behalf of a user).
  *
  * @param string $consumerKey    Twitter Application Consumer Key
  * @param string $consumerSecret Twitter Application Consumer Secret
  * @param string|null $callbackUrl Twitter Application Callback URL
  * @param string|null $accessToken Twitter Access Token
  * @param string|null $accessTokenSecret Twitter Access Token Secret
  */
 public function __construct($consumerKey, $consumerSecret, $callbackUrl = null, $accessToken = null, $accessTokenSecret = null)
 {
     parent::__construct($consumerKey, $consumerSecret);
     $this->accessToken = $accessToken;
     $this->accessTokenSecret = $accessTokenSecret;
     $this->callbackUrl = $callbackUrl;
 }
开发者ID:backupManager,项目名称:Twitter-API-PHP,代码行数:16,代码来源:UserCredentials.php


示例5: it_should_provide_a_basic_authentication_token

 /**
  * @test
  * @covers ::fromUsernameAndPassword
  * @covers ::basicAuthentication
  */
 public function it_should_provide_a_basic_authentication_token()
 {
     $username = 'mike';
     $password = 'itworks';
     $credentials = Credentials::fromUsernameAndPassword($username, $password);
     $this->assertSame('bWlrZTppdHdvcmtz', $credentials->basicAuthentication());
 }
开发者ID:php-in-practice,项目名称:matters-projections,代码行数:12,代码来源:CredentialsTest.php


示例6: testMakeDefault

 public function testMakeDefault()
 {
     $cred = $this->credentials('testUser');
     $cred->makeDefault($this->users('testUser')->id, 'email');
     $defaults = $cred->getDefaultCredentials(true);
     $default = Credentials::model()->findDefault($this->users('testUser')->id, 'email');
     $this->assertEquals($cred->id, $default->id, 'Failed asserting proper function of set-as-default method.');
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:8,代码来源:CredentialsTest.php


示例7: login

 /**
  * 
  * Authenticates the user using the supplied credentials.
  * If workspace is recognized as the name of an existing workspace in the repository and authorization to access that workspace is granted, then a new Session object is returned.
  * If authentication or authorization for the specified workspace fails, a LoginException is thrown.
  * If workspace is not recognized, a NoSuchWorkspaceException is thrown.
  * @param Credentials $credentials the credentials of the user.
  * @param string $workspace the name of the workspace.
  * @return Session a valid session for the user to access the repository.
  *  
  */
 public static function login(Credentials $credentials, $workspace)
 {
     if (!file_exists($_SERVER['PCR'] . "/config/{$workspace}.xml")) {
         throw new NoSuchWorkspaceException($workspace);
     }
     $config = simplexml_load_file($_SERVER['PCR'] . "/config/{$workspace}.xml");
     $persistenceManager = (string) $config->persistenceManager;
     if (!file_exists($_SERVER['PCR'] . "/PMs/{$persistenceManager}.php")) {
         throw new RepositoryException("persistence manager does not exist for workspace: {$workspace}=>{$persistenceManager}");
     }
     require_once $_SERVER['PCR'] . "/PMs/{$persistenceManager}.php";
     $pm = new $persistenceManager($credentials, $workspace, $config);
     if (!$pm->isLive()) {
         throw new LoginException("workspace=>{$workspace}, persistenceManager=>{$persistenceManager}, userID=>" . $credentials->getUserID());
     }
     Log4PCR::access("workspace=>{$workspace}, persistenceManager=>{$persistenceManager}, userID=>" . $credentials->getUserID());
     return new Session($pm);
 }
开发者ID:samueljwilliams,项目名称:pcr,代码行数:29,代码来源:Repository.php


示例8: testSubaccountDoesntExist

 public function testSubaccountDoesntExist()
 {
     $creds = Credentials::get();
     $client = new GSC_Client($creds["merchantId"]);
     $client->login($creds["email"], $creds["password"]);
     $errors = $client->getAccount("1");
     $errors = $errors->getErrors();
     $error = $errors[0];
     $this->assertEquals('ResourceNotFoundException', $error->getCode());
 }
开发者ID:wess87,项目名称:gshoppingcontent-php,代码行数:10,代码来源:GSC_ClientTest.php


示例9: __construct

 public function __construct(Credentials $credentials, $workspace, $config)
 {
     $link = @mysql_connect($config->server, $credentials->getUserID(), $credentials->getPassword(), 1);
     if (mysql_stat($link) !== null) {
         if (!mysql_select_db($workspace, $link)) {
             $sql = "CREATE DATABASE {$workspace}";
             if (mysql_query($sql, $link)) {
                 mysql_select_db($workspace, $link);
                 $sql = "CREATE TABLE c (p text NOT NULL,\n\t\t\t\t\t\t\t\tn text NOT NULL,\n\t\t\t\t\t\t\t\tv text NOT NULL,\n\t\t\t\t\t\t\t\tKEY INDEX1 (p (1000)),\n\t\t\t\t\t\t\t\tKEY INDEX2 (p (850), n (150)),\n\t\t\t\t\t\t\t\tKEY INDEX3 (p (550), n (150), v (300)),\n\t\t\t\t\t\t\t\tKEY INDEX4 (v (1000)))\n\t\t\t\t\t\t\t\tENGINE = MyISAM DEFAULT CHARSET = latin1";
                 mysql_query($sql, $link);
             } else {
                 throw new RepositoryException("in MySQL, cannot create workspace: {$workspace}");
             }
         }
         $this->credentials = $credentials;
         $this->workspace = $workspace;
         $this->config = $config;
         $this->link = $link;
         $this->isLive = true;
     }
 }
开发者ID:samueljwilliams,项目名称:pcr,代码行数:21,代码来源:MySQLPersistenceManager.php


示例10: testCount

 public function testCount()
 {
     foreach (DBTestPool::me()->getPool() as $db) {
         DBPool::me()->setDefault($db);
         $this->getDBCreator()->fillDB();
         $count = TestUser::dao()->getTotalCount();
         $this->assertGreaterThan(1, $count);
         $city = TestCity::create()->setId(1);
         $newUser = TestUser::create()->setCity($city)->setCredentials(Credentials::create()->setNickname('newuser')->setPassword(sha1('newuser')))->setLastLogin(Timestamp::create(time()))->setRegistered(Timestamp::create(time()));
         TestUser::dao()->add($newUser);
         $newCount = TestUser::dao()->getTotalCount();
         $this->assertEquals($count + 1, $newCount);
     }
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:14,代码来源:CountAndUnifiedDBTest.class.php


示例11: testIpAddressProperty

 public function testIpAddressProperty()
 {
     foreach (DBTestPool::me()->getPool() as $db) {
         DBPool::me()->setDefault($db);
         $city = TestCity::create()->setName('Khimki');
         TestCity::dao()->add($city);
         $userWithIp = TestUser::create()->setCredentials(Credentials::create()->setNickName('postgreser')->setPassword(sha1('postgreser')))->setLastLogin(Timestamp::makeNow())->setRegistered(Timestamp::makeNow())->setCity($city)->setIp(IpAddress::create('127.0.0.1'));
         TestUser::dao()->add($userWithIp);
         $this->assertTrue($userWithIp->getId() >= 1);
         $this->assertTrue($userWithIp->getIp() instanceof IpAddress);
         $plainIp = DBPool::me()->getByDao(TestUser::dao())->queryColumn(OSQL::select()->get('ip')->from(TestUser::dao()->getTable())->where(Expression::eq('id', $userWithIp->getId())));
         $this->assertEquals($plainIp[0], $userWithIp->getIp()->toString());
         $count = Criteria::create(TestUser::dao())->add(Expression::eq('ip', IpAddress::create('127.0.0.1')))->addProjection(Projection::count('*', 'count'))->getCustom('count');
         $this->assertEquals($count, 1);
     }
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:16,代码来源:IpDBTest.class.php


示例12: paramRules

 public function paramRules()
 {
     if (Yii::app()->isInSession) {
         $credOptsDict = Credentials::getCredentialOptions(null, true);
         $credOpts = $credOptsDict['credentials'];
         $selectedOpt = $credOptsDict['selectedOption'];
         foreach ($credOpts as $key => $val) {
             if ($key == $selectedOpt) {
                 $credOpts = array($key => $val) + $credOpts;
                 // move to beginning of array
                 break;
             }
         }
     } else {
         $credOpts = array();
     }
     return array_merge(parent::paramRules(), array('title' => Yii::t('studio', $this->title), 'info' => Yii::t('studio', $this->info), 'options' => array(array('name' => 'from', 'label' => Yii::t('studio', 'Send As:'), 'type' => 'dropdown', 'options' => $credOpts))));
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:18,代码来源:BaseX2FlowEmail.php


示例13: actionTwitterIntegration

 public function actionTwitterIntegration()
 {
     $credId = Yii::app()->settings->twitterCredentialsId;
     if ($credId && ($cred = Credentials::model()->findByPk($credId))) {
         $params = array('id' => $credId);
     } else {
         $params = array('class' => 'TwitterApp');
     }
     $url = Yii::app()->createUrl('/profile/createUpdateCredentials', $params);
     $this->redirect($url);
 }
开发者ID:xl602,项目名称:X2CRM,代码行数:11,代码来源:AdminController.php


示例14: renderModelInput


//.........这里部分代码省略.........
                                    label += "<span style=\\"font-size: 0.6em;\\">";

                                    // add email if defined
                                    if(item.subject) {
                                        label += "<br>";
                                        label += item.subject;
                                    }

                                    label += "</span>";
                                    label += "</a>";

                                    return $( "<li>" )
                                        .data( "item.autocomplete", item )
                                        .append( label )
                                        .appendTo( ul );
                                };
                            }' : '')), 'htmlOptions' => array_merge(array('title' => $field->attributeLabel), $htmlOptions)), true);
                if (isset($oldLinkFieldVal)) {
                    $model->{$fieldName} = $oldLinkFieldVal;
                }
                return $input;
            case 'rating':
                return Yii::app()->controller->widget('X2StarRating', array('model' => $model, 'attribute' => $field->fieldName, 'readOnly' => isset($htmlOptions['disabled']) && $htmlOptions['disabled'], 'minRating' => Fields::RATING_MIN, 'maxRating' => Fields::RATING_MAX, 'starCount' => Fields::RATING_MAX - Fields::RATING_MIN + 1, 'cssFile' => Yii::app()->theme->getBaseUrl() . '/css/rating/jquery.rating.css', 'htmlOptions' => $htmlOptions, 'callback' => 'function(value, link){
                        if (typeof x2 !== "undefined" &&
                            typeof x2.InlineEditor !== "undefined" &&
                            typeof x2.InlineEditor.ratingFields !== "undefined") {

                            x2.InlineEditor.ratingFields["' . $field->modelName . '[' . $field->fieldName . ']"] = value;
                        }
                    }'), true);
            case 'boolean':
                $checkbox = CHtml::openTag('div', X2Html::mergeHtmlOptions($htmlOptions, array('class' => 'checkboxWrapper')));
                $checkbox .= CHtml::activeCheckBox($model, $field->fieldName, array_merge(array('unchecked' => 0, 'title' => $field->attributeLabel), $htmlOptions));
                $checkbox .= CHtml::closeTag('div');
                return $checkbox;
            case 'assignment':
                $oldAssignmentVal = $model->{$fieldName};
                $model->{$fieldName} = !empty($model->{$fieldName}) ? $field->linkType == 'multiple' && !is_array($model->{$fieldName}) ? explode(', ', $model->{$fieldName}) : $model->{$fieldName} : X2Model::getDefaultAssignment();
                $dropdownList = CHtml::activeDropDownList($model, $fieldName, X2Model::getAssignmentOptions(true, true), array_merge(array('title' => $field->attributeLabel, 'id' => $field->modelName . '_' . $fieldName . '_assignedToDropdown', 'multiple' => $field->linkType == 'multiple' ? 'multiple' : null), $htmlOptions));
                $model->{$fieldName} = $oldAssignmentVal;
                return $dropdownList;
            case 'optionalAssignment':
                // optional assignment for users (can be left blank)
                $users = User::getNames();
                unset($users['Anyone']);
                return CHtml::activeDropDownList($model, $fieldName, $users, array_merge(array('title' => $field->attributeLabel, 'empty' => ''), $htmlOptions));
            case 'visibility':
                $permissionsBehavior = Yii::app()->params->modelPermissions;
                return CHtml::activeDropDownList($model, $field->fieldName, $permissionsBehavior::getVisibilityOptions(), array_merge(array('title' => $field->attributeLabel, 'id' => $field->modelName . "_visibility"), $htmlOptions));
                // 'varchar', 'email', 'url', 'int', 'float', 'currency', 'phone'
                // case 'int':
                // return CHtml::activeNumberField($model, $field->fieldNamearray_merge(array(
                // 'title' => $field->attributeLabel,
                // ), $htmlOptions));
            // 'varchar', 'email', 'url', 'int', 'float', 'currency', 'phone'
            // case 'int':
            // return CHtml::activeNumberField($model, $field->fieldNamearray_merge(array(
            // 'title' => $field->attributeLabel,
            // ), $htmlOptions));
            case 'percentage':
                $htmlOptions['class'] = empty($htmlOptions['class']) ? 'input-percentage' : $htmlOptions['class'] . ' input-percentage';
                return CHtml::activeTextField($model, $field->fieldName, array_merge(array('title' => $field->attributeLabel), $htmlOptions));
            case 'currency':
                $fieldName = $field->fieldName;
                $elementId = isset($htmlOptions['id']) ? '#' . $htmlOptions['id'] : '#' . $field->modelName . '_' . $field->fieldName;
                Yii::app()->controller->widget('application.extensions.moneymask.MMask', array('element' => $elementId, 'currency' => Yii::app()->params['currency'], 'config' => array('affixStay' => true, 'decimal' => Yii::app()->locale->getNumberSymbol('decimal'), 'thousands' => Yii::app()->locale->getNumberSymbol('group'))));
                return CHtml::activeTextField($model, $field->fieldName, array_merge(array('title' => $field->attributeLabel, 'class' => 'currency-field'), $htmlOptions));
            case 'credentials':
                $typeAlias = explode(':', $field->linkType);
                $type = $typeAlias[0];
                if (count($typeAlias) > 1) {
                    $uid = Credentials::$sysUseId[$typeAlias[1]];
                } else {
                    $uid = Yii::app()->user->id;
                }
                return Credentials::selectorField($model, $field->fieldName, $type, $uid);
            case 'timerSum':
                // Sorry, no-can-do. This is field derives its value from a sum over timer records.
                return $model->renderAttribute($field->fieldName);
            case 'float':
            case 'int':
                if (isset($model->{$fieldName})) {
                    $oldNumVal = $model->{$fieldName};
                    $model->{$fieldName} = Yii::app()->locale->numberFormatter->formatDecimal($model->{$fieldName});
                }
                $input = CHtml::activeTextField($model, $field->fieldName, array_merge(array('title' => $field->attributeLabel), $htmlOptions));
                if (isset($oldNumVal)) {
                    $model->{$fieldName} = $oldNumVal;
                }
                return $input;
            default:
                return CHtml::activeTextField($model, $field->fieldName, array_merge(array('title' => $field->attributeLabel), $htmlOptions));
                // array(
                // 'tabindex'=>isset($item['tabindex'])? $item['tabindex'] : null,
                // 'disabled'=>$item['readOnly']? 'disabled' : null,
                // 'title'=>$field->attributeLabel,
                // 'style'=>$default?'color:#aaa;':null,
                // ));
        }
    }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:101,代码来源:X2Model.php


示例15: renderCredentials

 protected function renderCredentials($field, $makeLinks, $textOnly, $encode)
 {
     $fieldName = $field->fieldName;
     $sysleg = Yii::t('app', 'System default (legacy)');
     if ($this->owner->{$fieldName} == -1) {
         return $sysleg;
     } else {
         $creds = Credentials::model()->findByPk($this->owner->{$fieldName});
         if (!empty($creds)) {
             return $this->render($creds->name, $encode);
         } else {
             return $sysleg;
         }
     }
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:15,代码来源:FieldFormatter.php


示例16: sendUserEmail

 /**
  * Send an email from X2Engine, returns an array with status code/message
  *
  * @param array addresses
  * @param string $subject the subject for the email
  * @param string $message the body of the email
  * @param array $attachments array of attachments to send
  * @param array|integer $from from and reply to address for the email array(name, address)
  *     or, if integer, the ID of a email credentials record to use for delivery.
  * @return array
  */
 public function sendUserEmail($addresses, $subject, $message, $attachments = null, $from = null)
 {
     $eml = new InlineEmail();
     if (is_array($addresses) ? count($addresses) == 0 : true) {
         throw new Exception('Invalid argument 1 sent to x2base.sendUserEmail(); expected a non-empty array, got instead: ' . var_export($addresses, 1));
     }
     // Set recipients:
     if (array_key_exists('to', $addresses) || array_key_exists('cc', $addresses) || array_key_exists('bcc', $addresses)) {
         $eml->mailingList = $addresses;
     } else {
         return array('code' => 500, 'message' => 'No recipients specified for email; array given for argument 1 of x2base.sendUserEmail does not have a "to", "cc" or "bcc" key.');
     }
     // Resolve sender (use stored email credentials or system default):
     if ($from === null || in_array($from, Credentials::$sysUseId)) {
         $from = (int) Credentials::model()->getDefaultUserAccount($from);
         // Set to the user's name/email if no valid defaults found:
         if ($from == Credentials::LEGACY_ID) {
             $from = array('name' => Yii::app()->params->profile->fullName, 'address' => Yii::app()->params->profile->emailAddress);
         }
     }
     if (is_numeric($from)) {
         $eml->credId = $from;
     } else {
         $eml->from = $from;
     }
     // Set other attributes
     $eml->subject = $subject;
     $eml->message = $message;
     $eml->attachments = $attachments;
     return $eml->deliver();
 }
开发者ID:shuvro35,项目名称:X2CRM,代码行数:42,代码来源:x2base.php


示例17: header

if (!isset($_POST["jsondata"])) {
    header('HTTP/1.1 404 Not Found');
    exit;
} else {
    try {
        $req = json_decode($_POST["jsondata"]);
        if (!isset($req->behavior)) {
            //these aren't the droids you're looking for...
            header('HTTP/1.1 404 Not Found');
            exit;
        } else {
            switch ($req->behavior) {
                case "getTokenFromCredentials":
                    $msg = new UATokenMessage();
                    // the constructor for Credentials can do some basic validation (or throw an exception)
                    $credentials = new Credentials($req->credentials->username, $req->credentials->password);
                    // the validate() method returns true if valid or false if invalid
                    if ($credentials->validate($token)) {
                        // the $token parameter was passed by reference and set inside validate()
                        $msg->token = $token;
                        //get the current time
                        $dt = new DateTime(null, new DateTimeZone("America/Los_Angeles"));
                        //expire the token in 10 seconds, this should probably reside inside validate
                        $dt->modify("+10 seconds");
                        $msg->expires = $dt->format(DateTime::RFC822);
                        //just some helpful status information for the caller
                        $msg->statuscode = 0;
                        $msg->statusdesc = "Login successful";
                    } else {
                        //bad credentials
                        $msg->statuscode = 1;
开发者ID:nordquip,项目名称:sousms,代码行数:31,代码来源:ua.php


示例18: buildMockProduct

 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *   WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 *   License for the specific language governing permissions and limitations
 *   under the License.
 *
 * @version 1.3
 * @author [email protected]
 * @copyright Google Inc, 2011
 * @package GShoppingContent
 */
// import our library
require_once 'GShoppingContent.php';
require_once 'BuildMockProduct.php';
// Get the user credentials
$creds = Credentials::get();
// Create a client for our merchant and log in
$client = new GSC_Client($creds["merchantId"]);
$client->login($creds["email"], $creds["password"]);
// Now enter some product data
$id = "SKU124";
$country = "US";
$language = "en";
$product = buildMockProduct($id, $country, $language);
// Finally send the data to the API
$warnings = false;
$dryRun = true;
$entry = $client->insertProduct($product, $warnings, $dryRun);
echo 'Dry Run Insert Response: ' . $entry->getTitle() . "\n\n";
// Verify the product still doesn't exist
$errors = $client->getProduct($id, $country, $language);
开发者ID:wess87,项目名称:gshoppingcontent-php,代码行数:31,代码来源:UseDryRun.php


示例19: CDbCriteria

<div class="page-title icon profile">
    <h2><?php 
echo Yii::t('profile', 'Manage Passwords for Third-Party Applications');
?>
</h2>
</div>
<div class="credentials-storage">
<?php 
$crit = new CDbCriteria(array('condition' => '(userId=:uid OR userId=-1) AND modelClass != "TwitterApp" AND 
        modelClass != "GoogleProject"', 'order' => 'name ASC', 'params' => array(':uid' => $profile->user->id)));
$staticModel = Credentials::model();
$staticModel->private = 0;
if (Yii::app()->user->checkAccess('CredentialsSelectNonPrivate', array('model' => $staticModel))) {
    $crit->addCondition('private=0', 'OR');
}
$dp = new CActiveDataProvider('Credentials', array('criteria' => $crit));
$this->widget('zii.widgets.CListView', array('dataProvider' => $dp, 'itemView' => '_credentialsView', 'itemsCssClass' => 'credentials-list', 'summaryText' => '', 'emptyText' => ''));
?>

    <?php 
echo CHtml::beginForm(array('/profile/createUpdateCredentials'), 'get', array('onSubmit' => 'return validate ();'));
echo CHtml::submitButton(Yii::t('app', 'Add New'), array('class' => 'x2-button', 'style' => 'float:left;margin-top:0'));
$modelLabels = Credentials::model()->authModelLabels;
unset($modelLabels['TwitterApp']);
$types = array_merge(array(null => '- ' . Yii::t('app', 'select a type') . ' -'), $modelLabels);
echo CHtml::dropDownList('class', 'EmailAccount', $types, array('options' => array_merge(array(null => array('selected' => 'selected')), array_fill_keys(array_keys($modelLabels), array('selected' => false))), 'class' => 'left x2-select'));
echo CHtml::endForm();
?>
</div>
开发者ID:tymiles003,项目名称:X2CRM,代码行数:29,代码来源:manageCredentials.php


示例20: array

?>
    <div class='email-inputs form'>
        <div class="row">
            <div id="inline-email-errors" class="error" style="display:none"></div>
            <?php 
echo $form->errorSummary($this->model, Yii::t('app', "Please fix the following errors:"), null);
?>
        </div>
        <div class="row email-input-row credId-row" 
         <?php 
echo $this->hideFromField ? 'style="display: none;"' : '';
?>
>
            <?php 
echo $form->label($this->model, 'credId', array('class' => 'credId-label x2-email-label'));
echo Credentials::selectorField($this->model, 'credId');
?>
        </div>
    <div class='addressee-rows'>
        <div class="row email-input-row email-to-row show-input-name">
            <?php 
//echo $form->label($this->model, 'to', array('class' => 'x2-email-label'));
echo $form->textField($this->model, 'to', array('id' => 'email-to', 'class' => 'x2-default-field', 'data-default-text' => CHtml::encode(Yii::t('app', 'Addressees')), 'tabindex' => '1'));
?>
            <div class='toggle-container'>
                <a href="javascript:void(0)" 
                 id="cc-toggle"<?php 
if (!empty($this->model->cc)) {
    echo ' style="display:none;"';
}
?>
开发者ID:dsyman2,项目名称:X2CRM,代码行数:31,代码来源:inlineEmailForm.php



注:本文中的Credentials类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Creole类代码示例发布时间:2022-05-23
下一篇:
PHP CreateDocx类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap