Skip to content

Commit

Permalink
Dev Replaced references to obsolete sha256 library for the PHP functi…
Browse files Browse the repository at this point in the history
…on and removed the library
  • Loading branch information
c-schmitz committed May 17, 2012
1 parent f1f4460 commit 834ead6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 508 deletions.
15 changes: 2 additions & 13 deletions application/controllers/InstallerController.php
Expand Up @@ -36,12 +36,6 @@ class InstallerController extends CController {
*/
public $lang = null;

/**
* Sha256
* @var Sha256
*/
private $sha256;

/**
* Checks for action specific authorization and then executes an action
*
Expand Down Expand Up @@ -626,10 +620,7 @@ private function stepOptionalConfiguration()

//checking DB Connection
if ($this->connection->getActive() == true) {
$this->loadLibrary('admin/sha256');
$this->sha256 = new SHA256;
$password_hash = $this->sha256->hashing($defaultpass);

$password_hash=hash('sha256', $defaultpass);
try {
$this->connection->createCommand()->insert("{{settings_global}}", array('stg_name' => 'SessionName', 'stg_value' => 'ls'.self::_getRandomID().self::_getRandomID().self::_getRandomID()));

Expand Down Expand Up @@ -1200,9 +1191,7 @@ function cmd_install_db()
echo $sError.PHP_EOL;
}

$this->loadLibrary('admin/sha256');
$this->sha256 = new SHA256;
$sPasswordHash = $this->sha256->hashing(Yii::app()->getConfig('defaultpass'));
$sPasswordHash=hash('sha256', Yii::app()->getConfig('defaultpass'));

try {
$this->connection->createCommand()->insert("{{settings_global}}", array('stg_name' => 'SessionName', 'stg_value' => 'ls'.self::_getRandomID().self::_getRandomID().self::_getRandomID()));
Expand Down
11 changes: 1 addition & 10 deletions application/helpers/common_helper.php
Expand Up @@ -6952,8 +6952,6 @@ function modifyDatabase($sqlfile='', $sqlstring='')
global $codeString;
global $modifyoutput;

Yii::app()->loadLibrary('admin/sha256','sha256');
$sha256 = new sha256;
$success = true; // Let's be optimistic
$modifyoutput='';

Expand Down Expand Up @@ -6985,7 +6983,7 @@ function modifyDatabase($sqlfile='', $sqlstring='')
$command .= $line;
$command = str_replace('prefix_', Yii::app()->db->tablePrefix, $command); // Table prefixes
$command = str_replace('$defaultuser', Yii::app()->getConfig('defaultuser'), $command);
$command = str_replace('$defaultpass', $sha256->hashing(Yii::app()->getConfig('defaultpass')), $command);
$command = str_replace('$defaultpass', hash('sha256',Yii::app()->getConfig('defaultpass')), $command);
$command = str_replace('$siteadminname', $siteadminname, $command);
$command = str_replace('$siteadminemail', $siteadminemail, $command);
$command = str_replace('$defaultlang', Yii::app()->getConfig('defaultlang'), $command);
Expand Down Expand Up @@ -7116,13 +7114,6 @@ function getPrintableHeader()
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="'.$rooturl.'/scripts/jquery/jquery.js"></script>
<script type="text/javascript" src="'.$homeurl.'/scripts/printablesurvey.js"></script>
<!--[if lt IE 7]>
<script type="text/javascript" src="'.$homeurl.'/scripts/DD_belatedPNG_0.0.8a-min.js"></script>
<script>
DD_belatedPNG.fix("img");
</script>
<![endif]-->
';
return $headelements;
}
Expand Down

0 comments on commit 834ead6

Please sign in to comment.