forked from extern/egroupware
extended the check for (admin-)accounts to other account storages
This commit is contained in:
parent
aac9ec7d10
commit
021d72b93e
@ -306,7 +306,6 @@
|
|||||||
* @param string $conf_pw the configured password
|
* @param string $conf_pw the configured password
|
||||||
* @returns bool
|
* @returns bool
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function check_auth($user,$pw,$conf_user,$conf_pw)
|
function check_auth($user,$pw,$conf_user,$conf_pw)
|
||||||
{
|
{
|
||||||
#echo "<p>setup::check_auth('$user','$pw','$conf_user','$conf_pw')</p>\n";exit;
|
#echo "<p>setup::check_auth('$user','$pw','$conf_user','$conf_pw')</p>\n";exit;
|
||||||
@ -947,6 +946,38 @@
|
|||||||
return $accountid;
|
return $accountid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if accounts other then the automatically installed anonymous account exist
|
||||||
|
*
|
||||||
|
* We check via the account object, to deal with different account-storages
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
function accounts_exist()
|
||||||
|
{
|
||||||
|
$this->setup_account_object();
|
||||||
|
|
||||||
|
$accounts = $GLOBALS['egw']->accounts->search(array(
|
||||||
|
'type' => 'accounts',
|
||||||
|
'start' => 0,
|
||||||
|
'offset' => 2, // we only need to check 2 accounts, if we just check for not anonymous
|
||||||
|
));
|
||||||
|
|
||||||
|
if (!$accounts || !is_array($accounts) || !count($accounts))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
foreach($accounts as $account)
|
||||||
|
{
|
||||||
|
if ($account['account_lid'] != 'anonymous')
|
||||||
|
{
|
||||||
|
// we might add further checks, eg. if the account really has admin rights here
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add ACL rights
|
* Add ACL rights
|
||||||
*
|
*
|
||||||
|
@ -512,9 +512,7 @@ function check_dir($dir,&$msg,$check_in_docroot=false)
|
|||||||
{
|
{
|
||||||
case 10:
|
case 10:
|
||||||
// check if there is already a user account (not the anonymous account of sitemgr or a group)
|
// check if there is already a user account (not the anonymous account of sitemgr or a group)
|
||||||
// Note: this does not check the availiblitly of accounts via other auth-methods then sql !!!
|
$no_accounts = !$GLOBALS['egw_setup']->accounts_exist();
|
||||||
$GLOBALS['egw_setup']->db->query("SELECT count(*) FROM phpgw_accounts WHERE account_type='u' AND account_lid!='anonymous'",__LINE__,__FILE__);
|
|
||||||
$no_accounts = !$GLOBALS['egw_setup']->db->next_record() || !$GLOBALS['egw_setup']->db->f(0);
|
|
||||||
$setup_tpl->set_var('admin_status_img',$no_accounts ? $incomplete : $completed);
|
$setup_tpl->set_var('admin_status_img',$no_accounts ? $incomplete : $completed);
|
||||||
$setup_tpl->set_var('admin_status_alt',$no_accounts ? lang('not completed') : lang('completed'));
|
$setup_tpl->set_var('admin_status_alt',$no_accounts ? lang('not completed') : lang('completed'));
|
||||||
$setup_tpl->set_var('admin_table_data',$GLOBALS['egw_setup']->html->make_frm_btn_simple(
|
$setup_tpl->set_var('admin_table_data',$GLOBALS['egw_setup']->html->make_frm_btn_simple(
|
||||||
|
Loading…
Reference in New Issue
Block a user