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
7d811e57
Commit
7d811e57
authored
12 years ago
by
Thomas Müller
Browse files
Options
Downloads
Patches
Plain Diff
setting the timezone is now part of the login process and true part of the core.
parent
ecf82d22
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
apps/files/ajax/timezone.php
+0
-2
0 additions, 2 deletions
apps/files/ajax/timezone.php
apps/files/index.php
+76
-79
76 additions, 79 deletions
apps/files/index.php
core/templates/login.php
+47
-29
47 additions, 29 deletions
core/templates/login.php
lib/base.php
+719
-697
719 additions, 697 deletions
lib/base.php
with
842 additions
and
807 deletions
apps/files/ajax/timezone.php
deleted
100644 → 0
+
0
−
2
View file @
ecf82d22
<?php
$_SESSION
[
'timezone'
]
=
$_GET
[
'time'
];
This diff is collapsed.
Click to expand it.
apps/files/index.php
+
76
−
79
View file @
7d811e57
<?php
/**
* ownCloud - ajax frontend
*
* @author Robin Appelman
* @copyright 2010 Robin Appelman icewind1991@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
* ownCloud - ajax frontend
*
* @author Robin Appelman
* @copyright 2010 Robin Appelman icewind1991@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Check if we are a user
OCP\User
::
checkLoggedIn
();
// Load the files we need
OCP\Util
::
addStyle
(
'files'
,
'files'
);
OCP\Util
::
addscript
(
'files'
,
'jquery.iframe-transport'
);
OCP\Util
::
addscript
(
'files'
,
'jquery.fileupload'
);
OCP\Util
::
addscript
(
'files'
,
'files'
);
OCP\Util
::
addscript
(
'files'
,
'filelist'
);
OCP\Util
::
addscript
(
'files'
,
'fileactions'
);
OCP\Util
::
addscript
(
'files'
,
'keyboardshortcuts'
);
if
(
!
isset
(
$_SESSION
[
'timezone'
]))
{
OCP\Util
::
addscript
(
'files'
,
'timezone'
);
}
OCP\App
::
setActiveNavigationEntry
(
'files_index'
);
OCP\Util
::
addStyle
(
'files'
,
'files'
);
OCP\Util
::
addscript
(
'files'
,
'jquery.iframe-transport'
);
OCP\Util
::
addscript
(
'files'
,
'jquery.fileupload'
);
OCP\Util
::
addscript
(
'files'
,
'files'
);
OCP\Util
::
addscript
(
'files'
,
'filelist'
);
OCP\Util
::
addscript
(
'files'
,
'fileactions'
);
OCP\Util
::
addscript
(
'files'
,
'keyboardshortcuts'
);
OCP\App
::
setActiveNavigationEntry
(
'files_index'
);
// Load the files
$dir
=
isset
(
$_GET
[
'dir'
]
)
?
stripslashes
(
$_GET
[
'dir'
])
:
''
;
$dir
=
isset
(
$_GET
[
'dir'
])
?
stripslashes
(
$_GET
[
'dir'
])
:
''
;
// Redirect if directory does not exist
if
(
!
OC_Filesystem
::
is_dir
(
$dir
.
'/'
))
{
header
(
'Location: '
.
$_SERVER
[
'SCRIPT_NAME'
]
.
''
);
exit
();
if
(
!
OC_Filesystem
::
is_dir
(
$dir
.
'/'
))
{
header
(
'Location: '
.
$_SERVER
[
'SCRIPT_NAME'
]
.
''
);
exit
();
}
$files
=
array
();
foreach
(
OC_Files
::
getdirectorycontent
(
$dir
)
as
$i
)
{
$i
[
'date'
]
=
OCP\Util
::
formatDate
(
$i
[
'mtime'
]
);
if
(
$i
[
'type'
]
==
'file'
)
{
$fileinfo
=
pathinfo
(
$i
[
'name'
]);
$i
[
'basename'
]
=
$fileinfo
[
'filename'
];
if
(
!
empty
(
$fileinfo
[
'extension'
]))
{
$i
[
'extension'
]
=
'.'
.
$fileinfo
[
'extension'
];
}
else
{
$i
[
'extension'
]
=
''
;
}
}
if
(
$i
[
'directory'
]
==
'/'
)
{
$i
[
'directory'
]
=
''
;
}
$files
[]
=
$i
;
foreach
(
OC_Files
::
getdirectorycontent
(
$dir
)
as
$i
)
{
$i
[
'date'
]
=
OCP\Util
::
formatDate
(
$i
[
'mtime'
]);
if
(
$i
[
'type'
]
==
'file'
)
{
$fileinfo
=
pathinfo
(
$i
[
'name'
]);
$i
[
'basename'
]
=
$fileinfo
[
'filename'
];
if
(
!
empty
(
$fileinfo
[
'extension'
]))
{
$i
[
'extension'
]
=
'.'
.
$fileinfo
[
'extension'
];
}
else
{
$i
[
'extension'
]
=
''
;
}
}
if
(
$i
[
'directory'
]
==
'/'
)
{
$i
[
'directory'
]
=
''
;
}
$files
[]
=
$i
;
}
// Make breadcrumb
$breadcrumb
=
array
();
$pathtohere
=
''
;
foreach
(
explode
(
'/'
,
$dir
)
as
$i
)
{
if
(
$i
!=
''
)
{
$pathtohere
.
=
'/'
.
$i
;
$breadcrumb
[]
=
array
(
'dir'
=>
$pathtohere
,
'name'
=>
$i
);
}
foreach
(
explode
(
'/'
,
$dir
)
as
$i
)
{
if
(
$i
!=
''
)
{
$pathtohere
.
=
'/'
.
$i
;
$breadcrumb
[]
=
array
(
'dir'
=>
$pathtohere
,
'name'
=>
$i
);
}
}
// make breadcrumb und filelist markup
$list
=
new
OCP\Template
(
'files'
,
'part.list'
,
''
);
$list
->
assign
(
'files'
,
$files
,
false
);
$list
->
assign
(
'baseURL'
,
OCP\Util
::
linkTo
(
'files'
,
'index.php'
)
.
'?dir='
,
false
);
$list
->
assign
(
'downloadURL'
,
OCP\Util
::
linkTo
(
'files'
,
'download.php'
)
.
'?file='
,
false
);
$breadcrumbNav
=
new
OCP\Template
(
'files'
,
'part.breadcrumb'
,
''
);
$breadcrumbNav
->
assign
(
'breadcrumb'
,
$breadcrumb
,
false
);
$breadcrumbNav
->
assign
(
'baseURL'
,
OCP\Util
::
linkTo
(
'files'
,
'index.php'
)
.
'?dir='
,
false
);
$list
=
new
OCP\Template
(
'files'
,
'part.list'
,
''
);
$list
->
assign
(
'files'
,
$files
,
false
);
$list
->
assign
(
'baseURL'
,
OCP\Util
::
linkTo
(
'files'
,
'index.php'
)
.
'?dir='
,
false
);
$list
->
assign
(
'downloadURL'
,
OCP\Util
::
linkTo
(
'files'
,
'download.php'
)
.
'?file='
,
false
);
$breadcrumbNav
=
new
OCP\Template
(
'files'
,
'part.breadcrumb'
,
''
);
$breadcrumbNav
->
assign
(
'breadcrumb'
,
$breadcrumb
,
false
);
$breadcrumbNav
->
assign
(
'baseURL'
,
OCP\Util
::
linkTo
(
'files'
,
'index.php'
)
.
'?dir='
,
false
);
$upload_max_filesize
=
OCP\Util
::
computerFileSize
(
ini_get
(
'upload_max_filesize'
));
$post_max_size
=
OCP\Util
::
computerFileSize
(
ini_get
(
'post_max_size'
));
$maxUploadFilesize
=
min
(
$upload_max_filesize
,
$post_max_size
);
$freeSpace
=
OC_Filesystem
::
free_space
(
$dir
);
$freeSpace
=
max
(
$freeSpace
,
0
);
$freeSpace
=
OC_Filesystem
::
free_space
(
$dir
);
$freeSpace
=
max
(
$freeSpace
,
0
);
$maxUploadFilesize
=
min
(
$maxUploadFilesize
,
$freeSpace
);
$permissions
=
OCP\PERMISSION_READ
;
if
(
OC_Filesystem
::
isUpdatable
(
$dir
.
'/'
))
{
$permissions
|=
OCP\PERMISSION_UPDATE
;
if
(
OC_Filesystem
::
isUpdatable
(
$dir
.
'/'
))
{
$permissions
|=
OCP\PERMISSION_UPDATE
;
}
if
(
OC_Filesystem
::
isDeletable
(
$dir
.
'/'
))
{
$permissions
|=
OCP\PERMISSION_DELETE
;
if
(
OC_Filesystem
::
isDeletable
(
$dir
.
'/'
))
{
$permissions
|=
OCP\PERMISSION_DELETE
;
}
if
(
OC_Filesystem
::
isSharable
(
$dir
.
'/'
))
{
$permissions
|=
OCP\PERMISSION_SHARE
;
if
(
OC_Filesystem
::
isSharable
(
$dir
.
'/'
))
{
$permissions
|=
OCP\PERMISSION_SHARE
;
}
$tmpl
=
new
OCP\Template
(
'files'
,
'index'
,
'user'
);
$tmpl
->
assign
(
'fileList'
,
$list
->
fetchPage
(),
false
);
$tmpl
->
assign
(
'breadcrumb'
,
$breadcrumbNav
->
fetchPage
(),
false
);
$tmpl
->
assign
(
'dir'
,
OC_Filesystem
::
normalizePath
(
$dir
));
$tmpl
->
assign
(
'isCreatable'
,
OC_Filesystem
::
isCreatable
(
$dir
.
'/'
));
$tmpl
=
new
OCP\Template
(
'files'
,
'index'
,
'user'
);
$tmpl
->
assign
(
'fileList'
,
$list
->
fetchPage
(),
false
);
$tmpl
->
assign
(
'breadcrumb'
,
$breadcrumbNav
->
fetchPage
(),
false
);
$tmpl
->
assign
(
'dir'
,
OC_Filesystem
::
normalizePath
(
$dir
));
$tmpl
->
assign
(
'isCreatable'
,
OC_Filesystem
::
isCreatable
(
$dir
.
'/'
));
$tmpl
->
assign
(
'permissions'
,
$permissions
);
$tmpl
->
assign
(
'files'
,
$files
);
$tmpl
->
assign
(
'uploadMaxFilesize'
,
$maxUploadFilesize
);
$tmpl
->
assign
(
'uploadMaxHumanFilesize'
,
OCP\Util
::
humanFileSize
(
$maxUploadFilesize
));
$tmpl
->
assign
(
'allowZipDownload'
,
intval
(
OCP\Config
::
getSystemValue
(
'allowZipDownload'
,
true
)));
$tmpl
->
assign
(
'files'
,
$files
);
$tmpl
->
assign
(
'uploadMaxFilesize'
,
$maxUploadFilesize
);
$tmpl
->
assign
(
'uploadMaxHumanFilesize'
,
OCP\Util
::
humanFileSize
(
$maxUploadFilesize
));
$tmpl
->
assign
(
'allowZipDownload'
,
intval
(
OCP\Config
::
getSystemValue
(
'allowZipDownload'
,
true
)));
$tmpl
->
printPage
();
This diff is collapsed.
Click to expand it.
core/templates/login.php
+
47
−
29
View file @
7d811e57
<!--[if IE 8]><style>input[type="checkbox"]{padding:0;}</style><![endif]-->
<form
method=
"post"
>
<fieldset>
<?php
if
(
!
empty
(
$_
[
'redirect_url'
]))
{
echo
'<input type="hidden" name="redirect_url" value="'
.
$_
[
'redirect_url'
]
.
'" />'
;
}
?>
<ul>
<?php
if
(
isset
(
$_
[
'invalidcookie'
])
&&
(
$_
[
'invalidcookie'
]))
:
?>
<li
class=
"errors"
>
<?php
echo
$l
->
t
(
'Automatic logon rejected!'
);
?>
<br>
<small>
<?php
echo
$l
->
t
(
'If you did not change your password recently, your account may be compromised!'
);
?>
</small><br>
<small>
<?php
echo
$l
->
t
(
'Please change your password to secure your account again.'
);
?>
</small>
</li>
<?php
endif
;
?>
<?php
if
(
isset
(
$_
[
'invalidpassword'
])
&&
(
$_
[
'invalidpassword'
]))
:
?>
<a
href=
"
<?php
echo
OC_Helper
::
linkToRoute
(
'core_lostpassword_index'
)
?>
"
><li
class=
"errors"
>
<?php
echo
$l
->
t
(
'Lost your password?'
);
?>
</li></a>
<?php
endif
;
?>
</ul>
<p
class=
"infield grouptop"
>
<input
type=
"text"
name=
"user"
id=
"user"
value=
"
<?php
echo
$_
[
'username'
];
?>
"
<?php
echo
$_
[
'user_autofocus'
]
?
' autofocus'
:
''
;
?>
autocomplete=
"on"
required
/>
<label
for=
"user"
class=
"infield"
>
<?php
echo
$l
->
t
(
'Username'
);
?>
</label>
<img
class=
"svg"
src=
"
<?php
echo
image_path
(
''
,
'actions/user.svg'
);
?>
"
alt=
""
/>
</p>
<p
class=
"infield groupbottom"
>
<input
type=
"password"
name=
"password"
id=
"password"
value=
""
required
<?php
echo
$_
[
'user_autofocus'
]
?
''
:
' autofocus'
;
?>
/>
<label
for=
"password"
class=
"infield"
>
<?php
echo
$l
->
t
(
'Password'
);
?>
</label>
<img
class=
"svg"
src=
"
<?php
echo
image_path
(
''
,
'actions/password.svg'
);
?>
"
alt=
""
/>
</p>
<input
type=
"checkbox"
name=
"remember_login"
value=
"1"
id=
"remember_login"
/><label
for=
"remember_login"
>
<?php
echo
$l
->
t
(
'remember'
);
?>
</label>
<input
type=
"submit"
id=
"submit"
class=
"login primary"
value=
"
<?php
echo
$l
->
t
(
'Log in'
);
?>
"
/>
</fieldset>
<fieldset>
<?php
if
(
!
empty
(
$_
[
'redirect_url'
]))
{
echo
'<input type="hidden" name="redirect_url" value="'
.
$_
[
'redirect_url'
]
.
'" />'
;
}
?>
<ul>
<?php
if
(
isset
(
$_
[
'invalidcookie'
])
&&
(
$_
[
'invalidcookie'
]))
:
?>
<li
class=
"errors"
>
<?php
echo
$l
->
t
(
'Automatic logon rejected!'
);
?>
<br>
<small>
<?php
echo
$l
->
t
(
'If you did not change your password recently, your account may be compromised!'
);
?>
</small>
<br>
<small>
<?php
echo
$l
->
t
(
'Please change your password to secure your account again.'
);
?>
</small>
</li>
<?php
endif
;
?>
<?php
if
(
isset
(
$_
[
'invalidpassword'
])
&&
(
$_
[
'invalidpassword'
]))
:
?>
<a
href=
"
<?php
echo
OC_Helper
::
linkToRoute
(
'core_lostpassword_index'
)
?>
"
>
<li
class=
"errors"
>
<?php
echo
$l
->
t
(
'Lost your password?'
);
?>
</li>
</a>
<?php
endif
;
?>
</ul>
<p
class=
"infield grouptop"
>
<input
type=
"text"
name=
"user"
id=
"user"
value=
"
<?php
echo
$_
[
'username'
];
?>
"
<?php
echo
$_
[
'user_autofocus'
]
?
' autofocus'
:
''
;
?>
autocomplete=
"on"
required
/>
<label
for=
"user"
class=
"infield"
>
<?php
echo
$l
->
t
(
'Username'
);
?>
</label>
<img
class=
"svg"
src=
"
<?php
echo
image_path
(
''
,
'actions/user.svg'
);
?>
"
alt=
""
/>
</p>
<p
class=
"infield groupbottom"
>
<input
type=
"password"
name=
"password"
id=
"password"
value=
""
required
<?php
echo
$_
[
'user_autofocus'
]
?
''
:
' autofocus'
;
?>
/>
<label
for=
"password"
class=
"infield"
>
<?php
echo
$l
->
t
(
'Password'
);
?>
</label>
<img
class=
"svg"
src=
"
<?php
echo
image_path
(
''
,
'actions/password.svg'
);
?>
"
alt=
""
/>
</p>
<input
type=
"checkbox"
name=
"remember_login"
value=
"1"
id=
"remember_login"
/><label
for=
"remember_login"
>
<?php
echo
$l
->
t
(
'remember'
);
?>
</label>
<input
type=
"hidden"
name=
"timezone-offset"
id=
"timezone-offset"
/>
<input
type=
"submit"
id=
"submit"
class=
"login primary"
value=
"
<?php
echo
$l
->
t
(
'Log in'
);
?>
"
/>
</fieldset>
</form>
<script>
$
(
document
).
ready
(
function
()
{
var
visitortimezone
=
(
-
new
Date
().
getTimezoneOffset
()
/
60
);
$
(
'
#timezone-offset
'
).
val
(
visitortimezone
);
});
</script>
This diff is collapsed.
Click to expand it.
lib/base.php
+
719
−
697
View file @
7d811e57
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