$ok = false;
elseif ( (!$request->user->is_staff) && (!$request->user->is_superuser) )
$ok = false;
-
+
if ($ok)
return true;
else
function IPF_Admin_Views_Index($request, $match){
$ca = checkAdminAuth($request);
if ($ca!==true) return $ca;
-
+
$apps = array();
$app_list = new IPF_Template_ContextVars();
foreach (IPF_Project::getInstance()->appList() as $app){
$models = new IPF_Template_ContextVars();
$models_found = false;
foreach($app->modelList() as $m){
-
+
$ma = IPF_Admin_Model::getModelAdmin($m);
if ($ma!==null){
$perms = $ma->getPerms($request);
if (array_search('view', $perms)!==false){
$models[] = new IPF_Template_ContextVars(array(
- 'name'=>$m,
+ 'name'=>$m,
'path'=>strtolower($m),
'perms'=>$perms,
));
}
}
}
-
+
$admin_log = IPF_ORM_Query::create()
->select("*")
->from('AdminLog')
->orderby('created_at desc')
->limit(10)
->execute();
-
+
$context = array(
- 'page_title' => __('Administration'),
+ 'page_title' => __('Administration'),
'app_list' => $app_list,
'admin_log' => $admin_log,
);
else
$form = new IPF_Auth_Forms_ChangePassword();
$context = array(
- 'page_title'=>'Change Password: '.$user->username,
+ 'page_title'=>'Change Password: '.$user->username,
'classname'=>'User',
'object'=>$user,
'form'=>$form,
$success_url = $request->REQUEST['next'];
if (trim($success_url)=='')
$success_url = IPF_HTTP_URL_urlForView('IPF_Admin_Views_Index');
-
+
if ($request->method == 'POST') {
$form = new IPF_Auth_Forms_Login($request->POST);
if ($form->isValid()){
if (isset($col['image']))
$type = 'image';
+ if (isset($col['html']))
+ $type = 'html';
+
$cn = 'IPF_Form_DB_'.$type;
$db_field = new $cn('', $name);
- //echo $name;
- //print_r($defaults);
-
if (null !== ($form_field=$db_field->formField($defaults))) {
$this->fields[$name] = $form_field;