Skip to content

Commit

Permalink
v2.1.02
Browse files Browse the repository at this point in the history
  • Loading branch information
rossdotparker committed Feb 14, 2017
1 parent 18a4c24 commit 6bfdf6d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
5 changes: 5 additions & 0 deletions Credentials/CHANGEDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,8 @@
++$count;
$sql[$count][0] = '2.1.01';
$sql[$count][1] = "";

//2.1.02
++$count;
$sql[$count][0] = '2.1.02';
$sql[$count][1] = "";
5 changes: 5 additions & 0 deletions Credentials/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
CHANGELOG
=========
2.1.02
------
Made credentials created by others editable
Added Notes field to import

2.1.01
------
Made credential view list visual
Expand Down
2 changes: 0 additions & 2 deletions Credentials/credentials_student.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,8 @@
}
echo '</td>';
echo '<td>';
if ($row['gibbonPersonIDCreator'] == $_SESSION[$guid]['gibbonPersonID']) {
echo "<a href='".$_SESSION[$guid]['absoluteURL'].'/index.php?q=/modules/'.$_SESSION[$guid]['module'].'/credentials_student_edit.php&search='.$search.'&credentialsCredentialID='.$row['credentialsCredentialID']."&gibbonPersonID=$gibbonPersonID&search=$search&allStudents=$allStudents'><img title='".__($guid, 'Edit')."' src='./themes/".$_SESSION[$guid]['gibbonThemeName']."/img/config.png'/></a> ";
echo "<a href='".$_SESSION[$guid]['absoluteURL'].'/index.php?q=/modules/'.$_SESSION[$guid]['module'].'/credentials_student_delete.php&search='.$search.'&credentialsCredentialID='.$row['credentialsCredentialID']."&gibbonPersonID=$gibbonPersonID&search=$search&allStudents=$allStudents'><img title='".__($guid, 'Delete')."' src='./themes/".$_SESSION[$guid]['gibbonThemeName']."/img/garbage.png'/></a>";
}
echo '</td>';
echo '</tr>';
}
Expand Down
11 changes: 6 additions & 5 deletions Credentials/import_credentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
<li><b><?php echo __($guid, 'Website') ?> *</b> - <?php echo __($guid, 'Title/name of website. Must exist in Manage Websites section.') ?></li>
<li><b><?php echo __($guid, 'Credential Username') ?></b></li>
<li><b><?php echo __($guid, 'Password') ?></b> - <?php echo __($guid, 'Plain text. It will be encrypted before being saved in database.') ?></li>
<li><b><?php echo __($guid, 'Notes') ?></b></li>
</ol>
</li>
<li><?php echo __($guid, 'Do not include a header row in the CSV files.') ?></li>
Expand Down Expand Up @@ -190,6 +191,7 @@
$users[$userSuccessCount]['title'] = $data[1];
$users[$userSuccessCount]['username2'] = $data[2];
$users[$userSuccessCount]['password'] = $data[3];
$users[$userSuccessCount]['notes'] = $data[4];
++$userSuccessCount;
} else {
echo "<div class='error'>";
Expand Down Expand Up @@ -268,8 +270,8 @@
if ($result->rowCount() < 1) { //INSERT
$credentialInsertFail = false;
try {
$data = array('username' => $user['username'], 'title' => $user['title'], 'username2' => $user['username2'], 'password' => $passwordFinal, 'gibbonPersonIDCreator' => $_SESSION[$guid]['gibbonPersonID'], 'timestampCreator' => date('Y-m-d H:i:s', time()));
$sql = 'INSERT INTO credentialsCredential SET gibbonPersonID=(SELECT gibbonPersonID FROM gibbonPerson WHERE username=:username), credentialsWebsiteID=(SELECT credentialsWebsiteID FROM credentialsWebsite WHERE title=:title), username=:username2, password=:password, gibbonPersonIDCreator=:gibbonPersonIDCreator, timestampCreator=:timestampCreator';
$data = array('username' => $user['username'], 'title' => $user['title'], 'username2' => $user['username2'], 'password' => $passwordFinal, 'notes' => $user['notes'], 'gibbonPersonIDCreator' => $_SESSION[$guid]['gibbonPersonID'], 'timestampCreator' => date('Y-m-d H:i:s', time()));
$sql = 'INSERT INTO credentialsCredential SET gibbonPersonID=(SELECT gibbonPersonID FROM gibbonPerson WHERE username=:username), credentialsWebsiteID=(SELECT credentialsWebsiteID FROM credentialsWebsite WHERE title=:title), username=:username2, password=:password, notes=:notes, gibbonPersonIDCreator=:gibbonPersonIDCreator, timestampCreator=:timestampCreator';
$result = $connection2->prepare($sql);
$result->execute($data);
} catch (PDOException $e) {
Expand All @@ -290,13 +292,12 @@
$credentialInsertFail = false;
$row = $result->fetch();
try {
$data = array('credentialsCredentialID' => $row['credentialsCredentialID'], 'username2' => $user['username2'], 'password' => $passwordFinal);
$sql = 'UPDATE credentialsCredential SET username=:username2, password=:password WHERE credentialsCredentialID=:credentialsCredentialID';
$data = array('credentialsCredentialID' => $row['credentialsCredentialID'], 'username2' => $user['username2'], 'password' => $passwordFinal, 'notes' => $user['notes']);
$sql = 'UPDATE credentialsCredential SET username=:username2, password=:password, notes=:notes WHERE credentialsCredentialID=:credentialsCredentialID';
$result = $connection2->prepare($sql);
$result->execute($data);
} catch (PDOException $e) {
$credentialInsertFail = true;
echo $e->getMessage();
}

//Spit out results
Expand Down
2 changes: 1 addition & 1 deletion Credentials/manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$entryURL = 'credentials.php';
$type = 'Additional';
$category = 'Admin';
$version = '2.1.01';
$version = '2.1.02';
$author = 'Ross Parker';
$url = 'http://rossparker.org';

Expand Down
2 changes: 1 addition & 1 deletion Credentials/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
/**
* Sets version information.
*/
$moduleVersion = '2.1.01';
$moduleVersion = '2.1.02';

0 comments on commit 6bfdf6d

Please sign in to comment.