Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
331bd527
Commit
331bd527
authored
11 years ago
by
Joas Schilling
Browse files
Options
Downloads
Patches
Plain Diff
Hide SMTP options based on selected send mode
Fix #7166
parent
fdb0d206
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
settings/js/admin.js
+20
-2
20 additions, 2 deletions
settings/js/admin.js
settings/templates/admin.php
+16
-16
16 additions, 16 deletions
settings/templates/admin.php
with
36 additions
and
18 deletions
settings/js/admin.js
+
20
−
2
View file @
331bd527
...
...
@@ -37,9 +37,27 @@ $(document).ready(function(){
$
(
'
#mail_smtpauth
'
).
change
(
function
()
{
if
(
!
this
.
checked
)
{
$
(
'
#mail_credentials
'
).
toggle
(
false
);
$
(
'
#mail_credentials
'
).
addClass
(
'
hidden
'
);
}
else
{
$
(
'
#mail_credentials
'
).
toggle
(
true
);
$
(
'
#mail_credentials
'
).
removeClass
(
'
hidden
'
);
}
});
$
(
'
#mail_smtpmode
'
).
change
(
function
()
{
if
(
$
(
this
).
val
()
!=
'
smtp
'
)
{
$
(
'
#setting_smtpauth
'
).
addClass
(
'
hidden
'
);
$
(
'
#setting_smtphost
'
).
addClass
(
'
hidden
'
);
$
(
'
#mail_smtpsecure_label
'
).
addClass
(
'
hidden
'
);
$
(
'
#mail_smtpsecure
'
).
addClass
(
'
hidden
'
);
$
(
'
#mail_credentials
'
).
addClass
(
'
hidden
'
);
}
else
{
$
(
'
#setting_smtpauth
'
).
removeClass
(
'
hidden
'
);
$
(
'
#setting_smtphost
'
).
removeClass
(
'
hidden
'
);
$
(
'
#mail_smtpsecure_label
'
).
removeClass
(
'
hidden
'
);
$
(
'
#mail_smtpsecure
'
).
removeClass
(
'
hidden
'
);
if
(
$
(
'
#mail_smtpauth
'
).
attr
(
'
checked
'
))
{
$
(
'
#mail_credentials
'
).
removeClass
(
'
hidden
'
);
}
}
});
...
...
This diff is collapsed.
Click to expand it.
settings/templates/admin.php
+
16
−
16
View file @
331bd527
...
...
@@ -288,8 +288,8 @@ if (!$_['internetconnectionworking']) {
<?php
endforeach
;
?>
</select>
<label
for=
"mail_smtpsecure"
>
<?php
p
(
$l
->
t
(
'Encryption'
));
?>
</label>
<select
name=
'
mail_smtpsecure
'
id=
'
mail_smtpsecure
'
>
<label
id=
"mail_smtpsecure_label"
for=
"mail_smtpsecure"
<?php
if
(
$_
[
'mail_smtpmode'
]
!=
'smtp'
)
print_unescaped
(
' class="hidden"'
);
?>
>
<?php
p
(
$l
->
t
(
'Encryption'
));
?>
</label>
<select
name=
"
mail_smtpsecure
"
id=
"
mail_smtpsecure
"
<?php
if
(
$_
[
'mail_smtpmode'
]
!=
'smtp'
)
print_unescaped
(
' class="hidden"'
);
?>
>
<?php
foreach
(
$mail_smtpsecure
as
$secure
=>
$name
)
:
$selected
=
''
;
if
(
$secure
==
$_
[
'mail_smtpsecure'
])
:
...
...
@@ -301,7 +301,14 @@ if (!$_['internetconnectionworking']) {
</p>
<p>
<label
for=
"mail_smtpauthtype"
>
<?php
p
(
$l
->
t
(
'Authentification method for SMTP'
));
?>
</label>
<label
for=
"mail_from_address"
>
<?php
p
(
$l
->
t
(
'From address'
));
?>
</label>
<input
type=
"text"
name=
'mail_from_address'
id=
"mail_from_address"
placeholder=
"
<?php
p
(
'owncloud'
)
?>
"
value=
'
<?php
p
(
$_
[
'mail_from_address'
])
?>
'
/>
@
<input
type=
"text"
name=
'mail_domain'
id=
"mail_domain"
placeholder=
"
<?php
p
(
'example.com'
)
?>
"
value=
'
<?php
p
(
$_
[
'mail_domain'
])
?>
'
/>
</p>
<p
id=
"setting_smtpauth"
<?php
if
(
$_
[
'mail_smtpmode'
]
!=
'smtp'
)
print_unescaped
(
' class="hidden"'
);
?>
>
<label
for=
"mail_smtpauthtype"
>
<?php
p
(
$l
->
t
(
'Authentification method'
));
?>
</label>
<select
name=
'mail_smtpauthtype'
id=
'mail_smtpauthtype'
>
<?php
foreach
(
$mail_smtpauthtype
as
$authtype
=>
$name
)
:
$selected
=
''
;
...
...
@@ -316,24 +323,17 @@ if (!$_['internetconnectionworking']) {
<label
for=
"mail_smtpauth"
>
<?php
p
(
$l
->
t
(
'Authentication required'
));
?>
</label>
</p>
<p
id=
"mail_credentials"
<?php
if
(
!
$_
[
'mail_smtpauth'
])
print_unescaped
(
' style="display: none;"'
);
?>
>
<label
for=
"mail_smtpname"
>
<?php
p
(
$l
->
t
(
'SMTP credentials'
));
?>
</label>
<input
type=
"text"
name=
'mail_smtpname'
id=
"mail_smtpname"
placeholder=
"
<?php
p
(
$l
->
t
(
'SMTP Username'
))
?>
"
value=
'
<?php
p
(
$_
[
'mail_smtpname'
])
?>
'
/>
<input
type=
"password"
name=
'mail_smtppassword'
id=
"mail_smtppassword"
placeholder=
"
<?php
p
(
$l
->
t
(
'SMTP Password'
))
?>
"
value=
'
<?php
p
(
$_
[
'mail_smtppassword'
])
?>
'
/>
</p>
<p>
<label
for=
"mail_smtphost"
>
<?php
p
(
$l
->
t
(
'SMTP server address'
));
?>
</label>
<p
id=
"setting_smtphost"
<?php
if
(
$_
[
'mail_smtpmode'
]
!=
'smtp'
)
print_unescaped
(
' class="hidden"'
);
?>
>
<label
for=
"mail_smtphost"
>
<?php
p
(
$l
->
t
(
'Server address'
));
?>
</label>
<input
type=
"text"
name=
'mail_smtphost'
id=
"mail_smtphost"
placeholder=
"
<?php
p
(
'smtp.example.com'
)
?>
"
value=
'
<?php
p
(
$_
[
'mail_smtphost'
])
?>
'
/>
:
<input
type=
"text"
name=
'mail_smtpport'
id=
"mail_smtpport"
placeholder=
"
<?php
p
(
$l
->
t
(
'Port'
))
?>
"
value=
'
<?php
p
(
$_
[
'mail_smtpport'
])
?>
'
/>
</p>
<p>
<label
for=
"mail_from_address"
>
<?php
p
(
$l
->
t
(
'From address'
));
?>
</label>
<input
type=
"text"
name=
'mail_from_address'
id=
"mail_from_address"
placeholder=
"
<?php
p
(
'owncloud'
)
?>
"
value=
'
<?php
p
(
$_
[
'mail_from_address'
])
?>
'
/>
@
<input
type=
"text"
name=
'mail_domain'
id=
"mail_domain"
placeholder=
"
<?php
p
(
'example.com'
)
?>
"
value=
'
<?php
p
(
$_
[
'mail_domain'
])
?>
'
/>
<p
id=
"mail_credentials"
<?php
if
(
!
$_
[
'mail_smtpauth'
]
||
$_
[
'mail_smtpmode'
]
!=
'smtp'
)
print_unescaped
(
' class="hidden"'
);
?>
>
<label
for=
"mail_smtpname"
>
<?php
p
(
$l
->
t
(
'Credentials'
));
?>
</label>
<input
type=
"text"
name=
'mail_smtpname'
id=
"mail_smtpname"
placeholder=
"
<?php
p
(
$l
->
t
(
'SMTP Username'
))
?>
"
value=
'
<?php
p
(
$_
[
'mail_smtpname'
])
?>
'
/>
<input
type=
"password"
name=
'mail_smtppassword'
id=
"mail_smtppassword"
placeholder=
"
<?php
p
(
$l
->
t
(
'SMTP Password'
))
?>
"
value=
'
<?php
p
(
$_
[
'mail_smtppassword'
])
?>
'
/>
</p>
</fieldset>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment