Improvements to web UI

This commit is contained in:
Daniil Gentili 2018-03-23 18:23:28 +01:00
parent 1847e4071e
commit 5fcbf77b99
3 changed files with 17 additions and 15 deletions

View File

@ -19,13 +19,8 @@ if (!file_exists('madeline.php')) {
}
include 'madeline.php';
// !!! This API id/API hash combination will not work !!!
// !!! You must get your own @ my.telegram.org !!!
$api_id = 0;
$api_hash = '';
$MadelineProto = new \danog\MadelineProto\API('session.madeline', ['app_info' => ['api_id' => $api_id, 'api_hash' => $api_hash]]);
$MadelineProto->start();
$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();
$me = $MadelineProto->get_self();

View File

@ -23,13 +23,8 @@ if (!file_exists('madeline.php')) {
}
include 'madeline.php';
// !!! This API id/API hash combination will not work !!!
// !!! You must get your own @ my.telegram.org !!!
$api_id = 0;
$api_hash = '';
$MadelineProto = new \danog\MadelineProto\API('session.madeline', ['app_info' => ['api_id' => $api_id, 'api_hash' => $api_hash]]);
$MadelineProto->start();
$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();
$me = $MadelineProto->get_self();

View File

@ -50,7 +50,19 @@ trait ApiTemplates
if (!isset($this->my_telegram_org_wrapper)) {
if (isset($_POST['type'])) {
if ($_POST['type'] === 'manual') {
echo $this->web_api_echo_template('Enter your API ID and API hash<br><b>'.$message.'</b>', '<input type="string" name="api_id" placeholder="API ID" required/><input type="string" name="api_hash" placeholder="API hash" required/>');
echo $this->web_api_echo_template('Enter your API ID and API hash<br><b>'.$message.'</b><ol>
<li>Login to my.telegram.org</li>
<li>Go to API development tools</li>
<li>
<ul>
<li>App title: your app&apos;s name, can be anything</li>
<li>Short name: your app&apos;s short name, only numbers and letters</li>
<li>Platform: Web</li>
<li>Description: describe your app here</li>
</ul>
</li>
<li>Click on create application</li>
</ol>', '<input type="string" name="api_id" placeholder="API ID" required/><input type="string" name="api_hash" placeholder="API hash" required/>');
} else {
echo $this->web_api_echo_template('Enter your phone number<br><b>'.$message.'</b>', '<input type="text" name="phone_number" placeholder="Phone number" required/>');
}