diff --git a/app/config/app.php b/app/config/app.php
index 1aacbf06ef96..4e029327dbe9 100755
--- a/app/config/app.php
+++ b/app/config/app.php
@@ -26,7 +26,7 @@ return array(
|
*/
- 'url' => 'https://www.invoiceninja.com',
+ 'url' => '',
/*
|--------------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 46b788f4fbf3..c996d417a2f0 100755
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -918,6 +918,13 @@ class AccountController extends \BaseController {
{
$this->userMailer->sendConfirmation($user);
}
+ else
+ {
+ //@file_get_contents(NINJA_APP_URL . "/signup/register/?first_name={$user->first_name}&last_name={$user->last_name}&email={$user->email}");
+ @file_get_contents('http://ninja.dev' . '/signup/register/?first_name=' . urlencode($user->first_name)
+ . '&last_name=' . urlencode($user->last_name)
+ . '&email=' . urlencode($user->email));
+ }
$activities = Activity::scope()->get();
foreach ($activities as $activity)
@@ -936,6 +943,24 @@ class AccountController extends \BaseController {
return "{$user->first_name} {$user->last_name}";
}
+ public function doRegister()
+ {
+ $affiliate = Affiliate::where('affiliate_key', '=', SELF_HOST_AFFILIATE_KEY)->first();
+
+ $license = new License;
+ $license->first_name = Input::get('first_name');
+ $license->last_name = Input::get('last_name');
+ $license->email = Input::get('email');
+ $license->transaction_reference = Request::getClientIp();
+ $license->license_key = Utils::generateLicense();
+ $license->affiliate_id = $affiliate->id;
+ $license->product_id = PRODUCT_SELF_HOST;
+ $license->is_claimed = 1;
+ $license->save();
+
+ return 'success';
+ }
+
public function cancelAccount()
{
$account = Auth::user()->account;
diff --git a/app/ninja/mailers/Mailer.php b/app/ninja/mailers/Mailer.php
index 7f758d49ed32..cf566da051c6 100755
--- a/app/ninja/mailers/Mailer.php
+++ b/app/ninja/mailers/Mailer.php
@@ -15,7 +15,12 @@ class Mailer {
Mail::send($views, $data, function($message) use ($toEmail, $fromEmail, $fromName, $subject)
{
$replyEmail = $fromEmail;
- $fromEmail = NINJA_FROM_EMAIL;
+
+ // http://stackoverflow.com/questions/2421234/gmail-appearing-to-ignore-reply-to
+ if ($toEmail != CONTACT_EMAIL)
+ {
+ $fromEmail = NINJA_FROM_EMAIL;
+ }
$message->to($toEmail)->from($fromEmail, $fromName)->replyTo($replyEmail, $fromName)->subject($subject);
});
diff --git a/app/routes.php b/app/routes.php
index e58b1606f6f4..88eaab596057 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -61,6 +61,7 @@ Route::get('claim_license', 'PaymentController@claim_license');
Route::post('signup/validate', 'AccountController@checkEmail');
Route::post('signup/submit', 'AccountController@submitSignup');
+Route::get('signup/register', 'AccountController@doRegister');
// Confide routes
Route::get('login', 'UserController@login');
@@ -265,8 +266,10 @@ define('PRO_PLAN_PRICE', 50);
define('PRODUCT_ONE_CLICK_INSTALL', 1);
define('PRODUCT_INVOICE_DESIGNS', 2);
define('PRODUCT_WHITE_LABEL', 3);
-define('DESIGNS_AFFILIATE_KEY', 'T3RS74');
+define('PRODUCT_SELF_HOST', 4);
define('WHITE_LABEL_AFFILIATE_KEY', '92D2J5');
+define('INVOICE_DESIGNS_AFFILIATE_KEY', 'T3RS74');
+define('SELF_HOST_AFFILIATE_KEY', '8S69AD');
define('USER_TYPE_SELF_HOST', 'SELF_HOST');
define('USER_TYPE_CLOUD_HOST', 'CLOUD_HOST');
diff --git a/app/views/header.blade.php b/app/views/header.blade.php
index f8dfeb0fe90a..eb4932197104 100755
--- a/app/views/header.blade.php
+++ b/app/views/header.blade.php
@@ -257,8 +257,9 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice