Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
lolo888
ISPConfig 3
Commits
f9c7f3f9
Commit
f9c7f3f9
authored
Jun 28, 2011
by
tbrehm
Browse files
- Added function to create random passwords in auth library.
- Fixed {RECORDID} placeholder in SQL datasource strings.
parent
8eb646a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
interface/lib/classes/auth.inc.php
View file @
f9c7f3f9
...
...
@@ -123,6 +123,15 @@ class auth {
exit
;
}
}
public
function
get_random_password
(
$length
=
8
)
{
$base64_alphabet
=
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
;
$password
=
''
;
for
(
$n
=
0
;
$n
<
$length
;
$n
++
)
{
$password
.
=
$base64_alphabet
[
mt_rand
(
0
,
63
)];
}
return
$password
;
}
}
...
...
interface/lib/classes/tform.inc.php
View file @
f9c7f3f9
...
...
@@ -166,6 +166,9 @@ class tform {
global
$conf
,
$app
;
if
(
!
is_array
(
$this
->
formDef
[
'tabs'
][
$tab
]))
$app
->
error
(
"Tab does not exist or the tab is empty (TAB:
$tab
)."
);
$new_record
=
''
;
$table_idx
=
$this
->
formDef
[
'db_table_idx'
];
if
(
isset
(
$record
[
$table_idx
]))
$new_record
[
$table_idx
]
=
intval
(
$record
[
$table_idx
]);
if
(
is_array
(
$record
))
{
foreach
(
$this
->
formDef
[
'tabs'
][
$tab
][
'fields'
]
as
$key
=>
$field
)
{
switch
(
$field
[
'datatype'
])
{
...
...
@@ -236,11 +239,12 @@ class tform {
$table_idx
=
$this
->
formDef
[
'db_table_idx'
];
$tmp_recordid
=
(
isset
(
$record
[
$table_idx
]))
?
$record
[
$table_idx
]
:
0
;
//$tmp_recordid = intval($this->primary_id);
$querystring
=
str_replace
(
"
{
RECORDID
}
"
,
$tmp_recordid
,
$querystring
);
unset
(
$tmp_recordid
);
$querystring
=
str_replace
(
"
{
AUTHSQL
}
"
,
$this
->
getAuthSQL
(
'r'
),
$querystring
);
// Getting the records
$tmp_records
=
$app
->
db
->
queryAllRecords
(
$querystring
);
if
(
$app
->
db
->
errorMessage
!=
''
)
die
(
$app
->
db
->
errorMessage
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment