Skip to content

Commit

Permalink
First Stable release
Browse files Browse the repository at this point in the history
  • Loading branch information
Hitmare committed Sep 20, 2017
1 parent 0181441 commit de75815
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Commands/getAuthkeyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public function execute()
{
$message = $this->getMessage();
$chat_id = $message->getChat()->getId();
$key = trim($message->getText(true));
$extchat = trim($message->getText(true));
$isUnlocked = Unlock::isUnlocked($chat_id);




$key = Unlock::getAuthkey($chat_id);
$key = Unlock::getAuthkey($extchat);
$text = 'The Authkey for the Channel ' . $chat_id . ': ' . $key;


Expand Down
2 changes: 1 addition & 1 deletion Commands/unlockCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function execute()
if ($key == '') {
$data = [
'chat_id' => $chat_id,
'text' => 'Please enter the given Key after the command `/unlock <key>`';
'text' => 'Please enter the given Key after the command `/unlock <key>`',
'parse_mode' => 'Markdown',
];
return Request::sendMessage($data);
Expand Down
3 changes: 2 additions & 1 deletion src/Unlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public static function unlockChannel($chat_id4, $key) {
$sth = $pdo->prepare($sql);
$sth->bindParam(':chat', $chat_id4, PDO::PARAM_INT);
$sth->bindParam(':status', $val, PDO::PARAM_INT);
$sth->bindParam(':key', $key, PDO::PARAM_INT);
$sth->execute();

return self::isUnlocked($chat_id4);
Expand Down Expand Up @@ -167,7 +168,7 @@ public static function getAuthkey($chat_id6) {
$sql = 'UPDATE `chat_unlock` SET `key` = :key WHERE `chat` = :chat';
$sth = $pdo->prepare($sql);
$sth->bindParam(':chat', $chat_id6, PDO::PARAM_INT);
$sth->bindParam(':authkey', $authkey, PDO::PARAM_STR);
$sth->bindParam(':key', $authkey, PDO::PARAM_STR);
$sth->execute();

// check if key is stored properly
Expand Down

0 comments on commit de75815

Please sign in to comment.