Adds Mastodon-integration as mentioned in issue #1802
这个提交包含在:
父节点
7090c95447
当前提交
613a89b8b4
共有 11 个文件被更改,包括 88 次插入 和 4 次删除
|
|
@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
|
|||
| be upgraded / downgraded to.
|
||||
|
|
||||
*/
|
||||
$config['migration_version'] = 125;
|
||||
$config['migration_version'] = 126;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ class User extends CI_Controller {
|
|||
$data['user_show_profile_image'] = $this->input->post('user_show_profile_image');
|
||||
$data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type');
|
||||
$data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload');
|
||||
$data['user_mastodon_url'] = $this->input->post('user_mastodon_url');
|
||||
$this->load->view('user/add', $data);
|
||||
} else {
|
||||
$this->load->view('user/add', $data);
|
||||
|
|
@ -116,7 +117,8 @@ class User extends CI_Controller {
|
|||
$this->input->post('user_column5'),
|
||||
$this->input->post('user_show_profile_image'),
|
||||
$this->input->post('user_previous_qsl_type'),
|
||||
$this->input->post('user_amsat_status_upload'))) {
|
||||
$this->input->post('user_amsat_status_upload'),
|
||||
$this->input->post('user_mastodon_url'))) {
|
||||
// Check for errors
|
||||
case EUSERNAMEEXISTS:
|
||||
$data['username_error'] = 'Username <b>'.$this->input->post('user_name').'</b> already in use!';
|
||||
|
|
@ -159,6 +161,7 @@ class User extends CI_Controller {
|
|||
$data['user_show_profile_image'] = $this->input->post('user_show_profile_image');
|
||||
$data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type');
|
||||
$data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload');
|
||||
$data['user_mastodon_url'] = $this->input->post('user_mastodon_url');
|
||||
$this->load->view('user/add', $data);
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
|
@ -366,6 +369,12 @@ class User extends CI_Controller {
|
|||
$data['user_amsat_status_upload'] = $q->user_amsat_status_upload;
|
||||
}
|
||||
|
||||
if($this->input->post('user_mastodon_url')) {
|
||||
$data['user_mastodon_url'] = $this->input->post('user_mastodon_url', false);
|
||||
} else {
|
||||
$data['user_mastodon_url'] = $q->user_mastodon_url;
|
||||
}
|
||||
|
||||
if($this->input->post('user_column1')) {
|
||||
$data['user_column1'] = $this->input->post('user_column1', true);
|
||||
} else {
|
||||
|
|
@ -451,6 +460,7 @@ class User extends CI_Controller {
|
|||
$data['user_show_profile_image'] = $this->input->post('user_show_profile_image');
|
||||
$data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type');
|
||||
$data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload');
|
||||
$data['user_mastodon_url'] = $this->input->post('user_mastodon_url');
|
||||
$this->load->view('user/edit');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,3 +89,6 @@ $lang['account_forgot_your_password'] = 'Forgot your password?';
|
|||
|
||||
$lang['account_login_to_cloudlog'] = 'Login to Cloudlog';
|
||||
$lang['account_login'] = 'Login';
|
||||
|
||||
$lang['account_mastodon'] = 'Mastodonserver';
|
||||
$lang['account_user_mastodon'] = 'URL of Mastodonserver';
|
||||
|
|
|
|||
|
|
@ -89,3 +89,6 @@ $lang['account_forgot_your_password'] = 'Salasana unohtunut?';
|
|||
|
||||
$lang['account_login_to_cloudlog'] = 'Kirjaudu Cloudlogiin';
|
||||
$lang['account_login'] = 'Kirjaudu';
|
||||
|
||||
$lang['account_mastodon'] = 'Mastodonserver';
|
||||
$lang['account_user_mastodon'] = 'URL of Mastodonserver';
|
||||
|
|
|
|||
|
|
@ -89,3 +89,6 @@ $lang['account_forgot_your_password'] = 'Passwort vergessen?';
|
|||
|
||||
$lang['account_login_to_cloudlog'] = 'Anmeldung bei Cloudlog';
|
||||
$lang['account_login'] = 'Anmeldung';
|
||||
|
||||
$lang['account_mastodon'] = 'Mastodonserver';
|
||||
$lang['account_user_mastodon'] = 'URL des Mastodonservers';
|
||||
|
|
|
|||
|
|
@ -89,3 +89,6 @@ $lang['account_forgot_your_password'] = 'Забыли пароль?';
|
|||
|
||||
$lang['account_login_to_cloudlog'] = 'Вход в Cloudlog';
|
||||
$lang['account_login'] = 'Вход';
|
||||
|
||||
$lang['account_mastodon'] = 'Mastodonserver';
|
||||
$lang['account_user_mastodon'] = 'URL of Mastodonserver';
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Class Migration_amsat_status_upload_option
|
||||
*
|
||||
* Creates a boolean column with option to allow for activating uploading
|
||||
* a status info to https://amsat.org/status
|
||||
*/
|
||||
|
||||
class Migration_mastodon_url extends CI_Migration {
|
||||
|
||||
public function up()
|
||||
{
|
||||
if (!$this->db->field_exists('user_mastodon_url', 'users')) {
|
||||
$fields = array(
|
||||
'user_mastodon_url varchar(32) default NULL',
|
||||
);
|
||||
$this->dbforge->add_column('users', $fields, 'user_column5');
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dbforge->drop_column('users', 'user_mastodon_url');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ class User_Model extends CI_Model {
|
|||
function add($username, $password, $email, $type, $firstname, $lastname, $callsign, $locator, $timezone,
|
||||
$measurement, $user_date_format, $user_stylesheet, $user_qth_lookup, $user_sota_lookup, $user_wwff_lookup,
|
||||
$user_pota_lookup, $user_show_notes, $user_column1, $user_column2, $user_column3, $user_column4, $user_column5,
|
||||
$user_show_profile_image, $user_previous_qsl_type, $user_amsat_status_upload) {
|
||||
$user_show_profile_image, $user_previous_qsl_type, $user_amsat_status_upload, $user_mastodon_url) {
|
||||
// Check that the user isn't already used
|
||||
if(!$this->exists($username)) {
|
||||
$data = array(
|
||||
|
|
@ -152,6 +152,7 @@ class User_Model extends CI_Model {
|
|||
'user_show_profile_image' => xss_clean($user_show_profile_image),
|
||||
'user_previous_qsl_type' => xss_clean($user_previous_qsl_type),
|
||||
'user_amsat_status_upload' => xss_clean($user_amsat_status_upload),
|
||||
'user_mastodon_url' => xss_clean($user_mastodon_url),
|
||||
);
|
||||
|
||||
// Check the password is valid
|
||||
|
|
@ -208,6 +209,7 @@ class User_Model extends CI_Model {
|
|||
'user_show_profile_image' => xss_clean($fields['user_show_profile_image']),
|
||||
'user_previous_qsl_type' => xss_clean($fields['user_previous_qsl_type']),
|
||||
'user_amsat_status_upload' => xss_clean($fields['user_amsat_status_upload']),
|
||||
'user_mastodon_url' => xss_clean($fields['user_mastodon_url']),
|
||||
);
|
||||
|
||||
// Check to see if the user is allowed to change user levels
|
||||
|
|
@ -328,6 +330,7 @@ class User_Model extends CI_Model {
|
|||
'user_column5' => isset($u->row()->user_column5) ? $u->row()->user_column5: 'Country',
|
||||
'user_previous_qsl_type' => isset($u->row()->user_previous_qsl_type) ? $u->row()->user_previous_qsl_type: 0,
|
||||
'user_amsat_status_upload' => isset($u->row()->user_amsat_status_upload) ? $u->row()->user_amsat_status_upload: 0,
|
||||
'user_mastodon_url' => $u->row()->user_mastodon_url,
|
||||
'active_station_logbook' => $u->row()->active_station_logbook,
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -514,6 +514,20 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<?php echo lang('account_mastodon'); ?>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label><?php echo lang('account_user_mastodon'); ?></label>
|
||||
<input class="form-control" type="text" name="user_mastodon_url" value="<?php if(isset($user_mastodon_url)) { echo $user_mastodon_url; } ?>" />
|
||||
<div class="small form-text text-muted">Main-URL of your Mastodonserver. f.ex. https://radiosocial.de</div></td>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" />
|
||||
|
|
|
|||
|
|
@ -512,7 +512,20 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<?php echo lang('account_mastodon'); ?>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label><?php echo lang('account_user_mastodon'); ?></label>
|
||||
<input class="form-control" type="text" name="user_mastodon_url" value="<?php if(isset($user_mastodon_url)) { echo $user_mastodon_url; } ?>" />
|
||||
<div class="small form-text text-muted">Main-URL of your Mastodonserver. f.ex. https://radiosocial.de</div></td>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" />
|
||||
|
|
|
|||
|
|
@ -407,6 +407,7 @@
|
|||
?>
|
||||
|
||||
<div style="display: inline-block;"><a class="btn btn-primary twitter-share-button" target="_blank" href="https://twitter.com/intent/tweet?text=<?php echo $twitter_string; ?>"><i class="fab fa-twitter"></i> Tweet</a></div>
|
||||
<?php if($this->session->userdata('user_mastodon_url') != null) { echo '<div style="display: inline-block;"><a class="btn btn-primary twitter-share-button" target="_blank" href="'.$this->session->userdata('user_mastodon_url').'/share?text='.$twitter_string.'"><i class="fab fa-mastodon"></i> Toot</a></div>'; } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
正在加载…
在新工单中引用