1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Don't use deprected "1" value to cURL CURLOPT_SSL_VERIFYHOST

Summary: Fixes T2962. That task discusses this issue.

Test Plan: Read php-curl documentation to verify this change makes sense. Sent an email with SES.

Reviewers: btrahan, garoevans

Reviewed By: garoevans

CC: aran

Maniphest Tasks: T2962

Differential Revision: https://secure.phabricator.com/D5669
This commit is contained in:
epriestley 2013-04-12 08:10:22 -07:00
parent 649f5cc178
commit 1e6deff8ba
5 changed files with 84 additions and 1 deletions

View file

@ -495,7 +495,7 @@ final class SimpleEmailServiceRequest
$curl = curl_init(); $curl = curl_init();
curl_setopt($curl, CURLOPT_USERAGENT, 'SimpleEmailService/php'); curl_setopt($curl, CURLOPT_USERAGENT, 'SimpleEmailService/php');
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, ($this->ses->verifyHost() ? 1 : 0)); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, ($this->ses->verifyHost() ? 2 : 0));
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, ($this->ses->verifyPeer() ? 1 : 0)); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, ($this->ses->verifyPeer() ? 1 : 0));
// Request types // Request types

View file

@ -1556,6 +1556,7 @@ phutil_register_library_map(array(
'PholioTransactionType' => 'applications/pholio/constants/PholioTransactionType.php', 'PholioTransactionType' => 'applications/pholio/constants/PholioTransactionType.php',
'PholioTransactionView' => 'applications/pholio/view/PholioTransactionView.php', 'PholioTransactionView' => 'applications/pholio/view/PholioTransactionView.php',
'PhortuneAccount' => 'applications/phortune/storage/PhortuneAccount.php', 'PhortuneAccount' => 'applications/phortune/storage/PhortuneAccount.php',
'PhortuneAccountBuyController' => 'applications/phortune/controller/PhortuneAccountBuyController.php',
'PhortuneAccountEditor' => 'applications/phortune/editor/PhortuneAccountEditor.php', 'PhortuneAccountEditor' => 'applications/phortune/editor/PhortuneAccountEditor.php',
'PhortuneAccountQuery' => 'applications/phortune/query/PhortuneAccountQuery.php', 'PhortuneAccountQuery' => 'applications/phortune/query/PhortuneAccountQuery.php',
'PhortuneAccountTransaction' => 'applications/phortune/storage/PhortuneAccountTransaction.php', 'PhortuneAccountTransaction' => 'applications/phortune/storage/PhortuneAccountTransaction.php',
@ -3252,6 +3253,7 @@ phutil_register_library_map(array(
0 => 'PhortuneDAO', 0 => 'PhortuneDAO',
1 => 'PhabricatorPolicyInterface', 1 => 'PhabricatorPolicyInterface',
), ),
'PhortuneAccountBuyController' => 'PhortuneController',
'PhortuneAccountEditor' => 'PhabricatorApplicationTransactionEditor', 'PhortuneAccountEditor' => 'PhabricatorApplicationTransactionEditor',
'PhortuneAccountQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhortuneAccountQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhortuneAccountTransaction' => 'PhabricatorApplicationTransaction', 'PhortuneAccountTransaction' => 'PhabricatorApplicationTransaction',

View file

@ -35,6 +35,7 @@ final class PhabricatorApplicationPhortune extends PhabricatorApplication {
'paymentmethod/' => array( 'paymentmethod/' => array(
'edit/' => 'PhortunePaymentMethodEditController', 'edit/' => 'PhortunePaymentMethodEditController',
), ),
'buy/(?P<id>\d+)/' => 'PhortuneAccountBuyController',
), ),
'account/' => array( 'account/' => array(
'' => 'PhortuneAccountListController', '' => 'PhortuneAccountListController',

View file

@ -0,0 +1,75 @@
<?php
final class PhortuneAccountBuyController
extends PhortuneController {
private $accountID;
private $id;
public function willProcessRequest(array $data) {
$this->accountID = $data['accountID'];
$this->id = $data['id'];
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$account = id(new PhortuneAccountQuery())
->setViewer($user)
->withIDs(array($this->accountID))
->executeOne();
if (!$account) {
return new Aphront404Response();
}
$account_uri = $this->getApplicationURI($account->getID().'/');
$product = id(new PhortuneProductQuery())
->setViewer($user)
->withIDs(array($this->id))
->executeOne();
if (!$product) {
return new Aphront404Response();
}
$title = pht('Buy %s', $product->getProductName());
$payment_method_uri = $this->getApplicationURI(
$account->getID().'/paymentmethod/edit/');
$new_method = phutil_tag(
'a',
array(
'href' => $payment_method_uri,
'sigil' => 'workflow',
),
pht('Add New Payment Method'));
$form = id(new AphrontFormView())
->setUser($user)
->appendChild(
id(new AphrontFormStaticControl())
->setLabel(pht('Stuff'))
->setValue($product->getProductName()))
->appendChild(
id(new AphrontFormRadioButtonControl())
->setLabel(pht('Payment Method')))
->appendChild(
id(new AphrontFormMarkupControl())
->setValue($new_method))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue(pht("Dolla Dolla Bill Y'all")));
return $this->buildApplicationPage(
$form,
array(
'title' => $title,
'device' => true,
'dust' => true,
));
}
}

View file

@ -45,6 +45,9 @@ final class PhabricatorEdgeConfig extends PhabricatorEdgeConstants {
const TYPE_ACCOUNT_HAS_MEMBER = 27; const TYPE_ACCOUNT_HAS_MEMBER = 27;
const TYPE_MEMBER_HAS_ACCOUNT = 28; const TYPE_MEMBER_HAS_ACCOUNT = 28;
const TYPE_PURCAHSE_HAS_CHARGE = 29;
const TYPE_CHARGE_HAS_PURCHASE = 30;
const TYPE_TEST_NO_CYCLE = 9000; const TYPE_TEST_NO_CYCLE = 9000;
@ -125,6 +128,8 @@ final class PhabricatorEdgeConfig extends PhabricatorEdgeConstants {
PhabricatorPHIDConstants::PHID_TYPE_CONP => 'ConpherenceThread', PhabricatorPHIDConstants::PHID_TYPE_CONP => 'ConpherenceThread',
PhabricatorPHIDConstants::PHID_TYPE_WIKI => 'PhrictionDocument', PhabricatorPHIDConstants::PHID_TYPE_WIKI => 'PhrictionDocument',
PhabricatorPHIDConstants::PHID_TYPE_ACNT => 'PhortuneAccount', PhabricatorPHIDConstants::PHID_TYPE_ACNT => 'PhortuneAccount',
PhabricatorPHIDConstants::PHID_TYPE_PRCH => 'PhortunePurchase',
PhabricatorPHIDConstants::PHID_TYPE_CHRG => 'PhortuneCharge',
); );
$class = idx($class_map, $phid_type); $class = idx($class_map, $phid_type);