Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r224 - in registry/trunk/app: Console/Command Lib

Subject: COmanage Developers List

List archive

[comanage-dev] r224 - in registry/trunk/app: Console/Command Lib


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r224 - in registry/trunk/app: Console/Command Lib
  • Date: Wed, 15 Feb 2012 11:18:08 -0500

Author: skoranda
Date: 2012-02-15 11:18:08 -0500 (Wed, 15 Feb 2012)
New Revision: 224

Modified:
registry/trunk/app/Console/Command/SetupShell.php
registry/trunk/app/Lib/lang.php
Log:
salt and seed handling at deployment for CO-202

Modified: registry/trunk/app/Console/Command/SetupShell.php
===================================================================
--- registry/trunk/app/Console/Command/SetupShell.php 2012-02-15 15:40:36
UTC (rev 223)
+++ registry/trunk/app/Console/Command/SetupShell.php 2012-02-15 16:18:08
UTC (rev 224)
@@ -35,6 +35,8 @@
$gn = $this->in(_txt('se.cf.admin.given'));
$sn = $this->in(_txt('se.cf.admin.sn'));
$user = $this->in(_txt('se.cf.admin.user'));
+ $salt = $this->in(_txt('se.cf.admin.salt'));
+ $seed = $this->in(_txt('se.cf.admin.seed'));

// Since we'll be doing some direct DB manipulation, find the table
prefix
$prefix = "";
@@ -190,6 +192,34 @@
$this->CoGroupMember->save($grm);
$grm_id = $this->CoGroupMember->id;

+ // Create the security salt file using a random string
+ // if one was not entered.
+
+ $this->out("- " . _txt('se.security.salt'));
+
+ if (!$salt) {
+ $salt =
str_repeat("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
10);
+ $salt = str_shuffle($salt);
+ $salt = substr($salt, 0, 40);
+ }
+
+ $securitySaltFilename = APP . "/Config/security.salt";
+ file_put_contents($securitySaltFilename, $salt);
+
+ // Create the security seed file using a random string
+ // if one was not entered.
+
+ $this->out("- " . _txt('se.security.seed'));
+
+ if (!$seed) {
+ $seed = str_repeat("0123456789", 100);
+ $seed = str_shuffle($seed);
+ $seed = substr($seed, 0, 29);
+ }
+
+ $securitySeedFilename = APP . "/Config/security.seed";
+ file_put_contents($securitySeedFilename, $seed);
+
// Clear the models in the cache since the cm_users view
// was just created and will not otherwise appear in the cache.
//

Modified: registry/trunk/app/Lib/lang.php
===================================================================
--- registry/trunk/app/Lib/lang.php 2012-02-15 15:40:36 UTC (rev 223)
+++ registry/trunk/app/Lib/lang.php 2012-02-15 16:18:08 UTC (rev 224)
@@ -402,10 +402,14 @@
'se.cf.admin.given' => 'Enter administrator\'s given name',
'se.cf.admin.sn' => 'Enter administrator\'s family name',
'se.cf.admin.user' => 'Enter administrator\'s login username',
+ 'se.cf.admin.salt' => 'Enter >= 40 character security salt or blank for
random',
+ 'se.cf.admin.seed' => 'Enter >= 29 digit security seed or blank for
random',
'se.db.co' => 'Creating COmanage CO',
'se.db.cop' => 'Adding Org Identity to CO',
'se.db.group' => 'Creating COmanage admin group',
'se.db.op' => 'Adding initial Org Identity',
+ 'se.security.salt' => 'Creating security salt file',
+ 'se.security.seed' => 'Creating security seed file',
'se.done' => 'Setup complete',
'se.users.view' => 'Creating users view'
);



  • [comanage-dev] r224 - in registry/trunk/app: Console/Command Lib, svnlog, 02/15/2012

Archive powered by MHonArc 2.6.16.

Top of Page