Move some common code to OC_Util
Created the following function: - checkLoggedIn - checkAdminUser - redirectToDefaultPagemaster
parent
406ca41f33
commit
a8574ea7bc
|
@ -18,14 +18,11 @@
|
|||
* MA 02111-1307 USA *
|
||||
*************************************************/
|
||||
require_once ("../../lib/base.php");
|
||||
if(!OC_USER::isLoggedIn()) {
|
||||
header("Location: " . OC_HELPER::linkTo("", "index.php"));
|
||||
exit;
|
||||
}
|
||||
OC_Util::checkLoggedIn();
|
||||
$cal = $_GET["calid"];
|
||||
$calendar = OC_Calendar_Calendar::findCalendar($cal);
|
||||
if($calendar["userid"] != OC_User::getUser()){
|
||||
header("Location: " . OC_HELPER::linkTo("", "index.php"));
|
||||
header( 'Location: '.OC_Helper::linkTo('', 'index.php'));
|
||||
exit;
|
||||
}
|
||||
$calobjects = OC_Calendar_Object::all($cal);
|
||||
|
|
|
@ -18,10 +18,7 @@
|
|||
* MA 02111-1307 USA *
|
||||
*************************************************/
|
||||
require_once ("../../lib/base.php");
|
||||
if(!OC_USER::isLoggedIn()) {
|
||||
header("Location: " . OC_HELPER::linkTo("", "index.php"));
|
||||
exit;
|
||||
}
|
||||
OC_Util::checkLoggedIn();
|
||||
// Create default calendar ...
|
||||
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
|
||||
if( count($calendars) == 0){
|
||||
|
|
Loading…
Reference in New Issue