Skip to content

Commit 1e6deff

Browse files
author
epriestley
committedApr 12, 2013
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
1 parent 649f5cc commit 1e6deff

File tree

5 files changed

+84
-1
lines changed

5 files changed

+84
-1
lines changed
 

‎externals/amazon-ses/ses.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ public function getResponse() {
495495
$curl = curl_init();
496496
curl_setopt($curl, CURLOPT_USERAGENT, 'SimpleEmailService/php');
497497

498-
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, ($this->ses->verifyHost() ? 1 : 0));
498+
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, ($this->ses->verifyHost() ? 2 : 0));
499499
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, ($this->ses->verifyPeer() ? 1 : 0));
500500

501501
// Request types

‎src/__phutil_library_map__.php

+2
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,7 @@
15561556
'PholioTransactionType' => 'applications/pholio/constants/PholioTransactionType.php',
15571557
'PholioTransactionView' => 'applications/pholio/view/PholioTransactionView.php',
15581558
'PhortuneAccount' => 'applications/phortune/storage/PhortuneAccount.php',
1559+
'PhortuneAccountBuyController' => 'applications/phortune/controller/PhortuneAccountBuyController.php',
15591560
'PhortuneAccountEditor' => 'applications/phortune/editor/PhortuneAccountEditor.php',
15601561
'PhortuneAccountQuery' => 'applications/phortune/query/PhortuneAccountQuery.php',
15611562
'PhortuneAccountTransaction' => 'applications/phortune/storage/PhortuneAccountTransaction.php',
@@ -3252,6 +3253,7 @@
32523253
0 => 'PhortuneDAO',
32533254
1 => 'PhabricatorPolicyInterface',
32543255
),
3256+
'PhortuneAccountBuyController' => 'PhortuneController',
32553257
'PhortuneAccountEditor' => 'PhabricatorApplicationTransactionEditor',
32563258
'PhortuneAccountQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
32573259
'PhortuneAccountTransaction' => 'PhabricatorApplicationTransaction',

‎src/applications/phortune/application/PhabricatorApplicationPhortune.php

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function getRoutes() {
3535
'paymentmethod/' => array(
3636
'edit/' => 'PhortunePaymentMethodEditController',
3737
),
38+
'buy/(?P<id>\d+)/' => 'PhortuneAccountBuyController',
3839
),
3940
'account/' => array(
4041
'' => 'PhortuneAccountListController',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?php
2+
3+
final class PhortuneAccountBuyController
4+
extends PhortuneController {
5+
6+
private $accountID;
7+
private $id;
8+
9+
public function willProcessRequest(array $data) {
10+
$this->accountID = $data['accountID'];
11+
$this->id = $data['id'];
12+
}
13+
14+
public function processRequest() {
15+
$request = $this->getRequest();
16+
$user = $request->getUser();
17+
18+
$account = id(new PhortuneAccountQuery())
19+
->setViewer($user)
20+
->withIDs(array($this->accountID))
21+
->executeOne();
22+
if (!$account) {
23+
return new Aphront404Response();
24+
}
25+
26+
$account_uri = $this->getApplicationURI($account->getID().'/');
27+
28+
$product = id(new PhortuneProductQuery())
29+
->setViewer($user)
30+
->withIDs(array($this->id))
31+
->executeOne();
32+
if (!$product) {
33+
return new Aphront404Response();
34+
}
35+
36+
$title = pht('Buy %s', $product->getProductName());
37+
38+
$payment_method_uri = $this->getApplicationURI(
39+
$account->getID().'/paymentmethod/edit/');
40+
41+
$new_method = phutil_tag(
42+
'a',
43+
array(
44+
'href' => $payment_method_uri,
45+
'sigil' => 'workflow',
46+
),
47+
pht('Add New Payment Method'));
48+
49+
50+
$form = id(new AphrontFormView())
51+
->setUser($user)
52+
->appendChild(
53+
id(new AphrontFormStaticControl())
54+
->setLabel(pht('Stuff'))
55+
->setValue($product->getProductName()))
56+
->appendChild(
57+
id(new AphrontFormRadioButtonControl())
58+
->setLabel(pht('Payment Method')))
59+
->appendChild(
60+
id(new AphrontFormMarkupControl())
61+
->setValue($new_method))
62+
->appendChild(
63+
id(new AphrontFormSubmitControl())
64+
->setValue(pht("Dolla Dolla Bill Y'all")));
65+
66+
return $this->buildApplicationPage(
67+
$form,
68+
array(
69+
'title' => $title,
70+
'device' => true,
71+
'dust' => true,
72+
));
73+
74+
}
75+
}

‎src/infrastructure/edges/constants/PhabricatorEdgeConfig.php

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ final class PhabricatorEdgeConfig extends PhabricatorEdgeConstants {
4545
const TYPE_ACCOUNT_HAS_MEMBER = 27;
4646
const TYPE_MEMBER_HAS_ACCOUNT = 28;
4747

48+
const TYPE_PURCAHSE_HAS_CHARGE = 29;
49+
const TYPE_CHARGE_HAS_PURCHASE = 30;
50+
4851
const TYPE_TEST_NO_CYCLE = 9000;
4952

5053

@@ -125,6 +128,8 @@ public static function establishConnection($phid_type, $conn_type) {
125128
PhabricatorPHIDConstants::PHID_TYPE_CONP => 'ConpherenceThread',
126129
PhabricatorPHIDConstants::PHID_TYPE_WIKI => 'PhrictionDocument',
127130
PhabricatorPHIDConstants::PHID_TYPE_ACNT => 'PhortuneAccount',
131+
PhabricatorPHIDConstants::PHID_TYPE_PRCH => 'PhortunePurchase',
132+
PhabricatorPHIDConstants::PHID_TYPE_CHRG => 'PhortuneCharge',
128133
);
129134

130135
$class = idx($class_map, $phid_type);

0 commit comments

Comments
 (0)
Failed to load comments.