Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2025-01-31 10:08:56 +01:00
Remove unused UserOrganization.invited_by_email
Dieser Commit ist enthalten in:
Ursprung
b9e257b469
Commit
0e8a462eb0
12 geänderte Dateien mit 10 neuen und 24 gelöschten Zeilen
|
@ -1 +0,0 @@
|
||||||
ALTER TABLE users_organizations DROP COLUMN invited_by_email;
|
|
|
@ -1 +0,0 @@
|
||||||
ALTER TABLE users_organizations ADD COLUMN invited_by_email TEXT DEFAULT NULL;
|
|
|
@ -1 +0,0 @@
|
||||||
ALTER TABLE users_organizations DROP COLUMN invited_by_email;
|
|
|
@ -1 +0,0 @@
|
||||||
ALTER TABLE users_organizations ADD COLUMN invited_by_email TEXT DEFAULT NULL;
|
|
|
@ -1 +0,0 @@
|
||||||
ALTER TABLE users_organizations DROP COLUMN invited_by_email;
|
|
|
@ -1 +0,0 @@
|
||||||
ALTER TABLE users_organizations ADD COLUMN invited_by_email TEXT DEFAULT NULL;
|
|
|
@ -177,7 +177,7 @@ async fn create_organization(headers: Headers, data: Json<OrgData>, mut conn: Db
|
||||||
};
|
};
|
||||||
|
|
||||||
let org = Organization::new(data.name, data.billing_email, private_key, public_key);
|
let org = Organization::new(data.name, data.billing_email, private_key, public_key);
|
||||||
let mut user_org = UserOrganization::new(headers.user.uuid, org.uuid.clone(), None);
|
let mut user_org = UserOrganization::new(headers.user.uuid, org.uuid.clone());
|
||||||
let collection = Collection::new(org.uuid.clone(), data.collection_name, None);
|
let collection = Collection::new(org.uuid.clone(), data.collection_name, None);
|
||||||
|
|
||||||
user_org.akey = data.key;
|
user_org.akey = data.key;
|
||||||
|
@ -955,8 +955,7 @@ async fn send_invite(org_id: &str, data: Json<InviteData>, headers: AdminHeaders
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut new_member =
|
let mut new_member = UserOrganization::new(user.uuid.clone(), String::from(org_id));
|
||||||
UserOrganization::new(user.uuid.clone(), String::from(org_id), Some(headers.user.email.clone()));
|
|
||||||
let access_all = data.access_all;
|
let access_all = data.access_all;
|
||||||
new_member.access_all = access_all;
|
new_member.access_all = access_all;
|
||||||
new_member.atype = new_type;
|
new_member.atype = new_type;
|
||||||
|
@ -2127,12 +2126,10 @@ async fn import(org_id: &str, data: Json<OrgImportData>, headers: Headers, mut c
|
||||||
UserOrgStatus::Accepted as i32 // Automatically mark user as accepted if no email invites
|
UserOrgStatus::Accepted as i32 // Automatically mark user as accepted if no email invites
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut new_member =
|
let mut new_member = UserOrganization::new(user.uuid.clone(), String::from(org_id));
|
||||||
UserOrganization::new(user.uuid.clone(), String::from(org_id), Some(headers.user.email.clone()));
|
|
||||||
new_member.access_all = false;
|
new_member.access_all = false;
|
||||||
new_member.atype = UserOrgType::User as i32;
|
new_member.atype = UserOrgType::User as i32;
|
||||||
new_member.status = user_org_status;
|
new_member.status = user_org_status;
|
||||||
|
|
||||||
new_member.save(&mut conn).await?;
|
new_member.save(&mut conn).await?;
|
||||||
|
|
||||||
log_event(
|
log_event(
|
||||||
|
|
|
@ -110,12 +110,7 @@ async fn ldap_import(data: Json<OrgImportData>, token: PublicToken, mut conn: Db
|
||||||
UserOrgStatus::Accepted as i32 // Automatically mark user as accepted if no email invites
|
UserOrgStatus::Accepted as i32 // Automatically mark user as accepted if no email invites
|
||||||
};
|
};
|
||||||
|
|
||||||
let (org_name, org_email) = match Organization::find_by_uuid(&org_id, &mut conn).await {
|
let mut new_member = UserOrganization::new(user.uuid.clone(), org_id.clone());
|
||||||
Some(org) => (org.name, org.billing_email),
|
|
||||||
None => err!("Error looking up organization"),
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut new_member = UserOrganization::new(user.uuid.clone(), org_id.clone(), Some(org_email.clone()));
|
|
||||||
new_member.set_external_id(Some(user_data.external_id.clone()));
|
new_member.set_external_id(Some(user_data.external_id.clone()));
|
||||||
new_member.access_all = false;
|
new_member.access_all = false;
|
||||||
new_member.atype = UserOrgType::User as i32;
|
new_member.atype = UserOrgType::User as i32;
|
||||||
|
@ -124,6 +119,11 @@ async fn ldap_import(data: Json<OrgImportData>, token: PublicToken, mut conn: Db
|
||||||
new_member.save(&mut conn).await?;
|
new_member.save(&mut conn).await?;
|
||||||
|
|
||||||
if CONFIG.mail_enabled() {
|
if CONFIG.mail_enabled() {
|
||||||
|
let (org_name, org_email) = match Organization::find_by_uuid(&org_id, &mut conn).await {
|
||||||
|
Some(org) => (org.name, org.billing_email),
|
||||||
|
None => err!("Error looking up organization"),
|
||||||
|
};
|
||||||
|
|
||||||
if let Err(e) = mail::send_invite(
|
if let Err(e) = mail::send_invite(
|
||||||
&user,
|
&user,
|
||||||
Some(org_id.clone()),
|
Some(org_id.clone()),
|
||||||
|
|
|
@ -29,7 +29,6 @@ db_object! {
|
||||||
pub uuid: String,
|
pub uuid: String,
|
||||||
pub user_uuid: String,
|
pub user_uuid: String,
|
||||||
pub org_uuid: String,
|
pub org_uuid: String,
|
||||||
pub invited_by_email: Option<String>,
|
|
||||||
|
|
||||||
pub access_all: bool,
|
pub access_all: bool,
|
||||||
pub akey: String,
|
pub akey: String,
|
||||||
|
@ -216,13 +215,12 @@ impl Organization {
|
||||||
static ACTIVATE_REVOKE_DIFF: i32 = 128;
|
static ACTIVATE_REVOKE_DIFF: i32 = 128;
|
||||||
|
|
||||||
impl UserOrganization {
|
impl UserOrganization {
|
||||||
pub fn new(user_uuid: String, org_uuid: String, invited_by_email: Option<String>) -> Self {
|
pub fn new(user_uuid: String, org_uuid: String) -> Self {
|
||||||
Self {
|
Self {
|
||||||
uuid: crate::util::get_uuid(),
|
uuid: crate::util::get_uuid(),
|
||||||
|
|
||||||
user_uuid,
|
user_uuid,
|
||||||
org_uuid,
|
org_uuid,
|
||||||
invited_by_email,
|
|
||||||
|
|
||||||
access_all: false,
|
access_all: false,
|
||||||
akey: String::new(),
|
akey: String::new(),
|
||||||
|
|
|
@ -234,7 +234,6 @@ table! {
|
||||||
uuid -> Text,
|
uuid -> Text,
|
||||||
user_uuid -> Text,
|
user_uuid -> Text,
|
||||||
org_uuid -> Text,
|
org_uuid -> Text,
|
||||||
invited_by_email -> Nullable<Text>,
|
|
||||||
access_all -> Bool,
|
access_all -> Bool,
|
||||||
akey -> Text,
|
akey -> Text,
|
||||||
status -> Integer,
|
status -> Integer,
|
||||||
|
|
|
@ -234,7 +234,6 @@ table! {
|
||||||
uuid -> Text,
|
uuid -> Text,
|
||||||
user_uuid -> Text,
|
user_uuid -> Text,
|
||||||
org_uuid -> Text,
|
org_uuid -> Text,
|
||||||
invited_by_email -> Nullable<Text>,
|
|
||||||
access_all -> Bool,
|
access_all -> Bool,
|
||||||
akey -> Text,
|
akey -> Text,
|
||||||
status -> Integer,
|
status -> Integer,
|
||||||
|
|
|
@ -234,7 +234,6 @@ table! {
|
||||||
uuid -> Text,
|
uuid -> Text,
|
||||||
user_uuid -> Text,
|
user_uuid -> Text,
|
||||||
org_uuid -> Text,
|
org_uuid -> Text,
|
||||||
invited_by_email -> Nullable<Text>,
|
|
||||||
access_all -> Bool,
|
access_all -> Bool,
|
||||||
akey -> Text,
|
akey -> Text,
|
||||||
status -> Integer,
|
status -> Integer,
|
||||||
|
|
Laden …
Tabelle hinzufügen
In neuem Issue referenzieren