<commit_before><?php

 /**
  * Friendica admin
  */
require_once("include/remoteupdate.php");
 
function admin_post(&$a){
	if(!is_site_admin()) {
		return;
	}
	
	// urls
	if ($a->argc > 1){
		switch ($a->argv[1]){
			case 'site':
				admin_page_site_post($a);
				break;
			case 'users':
				admin_page_users_post($a);
				break;
			case 'plugins':
				if ($a->argc > 2 && 
					is_file("addon/".$a->argv[2]."/".$a->argv[2].".php")){
						@include_once("addon/".$a->argv[2]."/".$a->argv[2].".php");
						if(function_exists($a->argv[2].'_plugin_admin_post')) {
							$func = $a->argv[2].'_plugin_admin_post';
							$func($a);
						}
				}
				goaway($a->get_baseurl() . '/admin/plugins/' . $a->argv[2] );
				return; // NOTREACHED
				break;
			case 'logs':
				admin_page_logs_post($a);
				break;
			case 'update':
				admin_page_remoteupdate_post($a);
				break;
		}
	}

	goaway($a->get_baseurl() . '/admin' );
	return; // NOTREACHED	
}

function admin_content(&$a) {

	if(!is_site_admin()) {
		return login(false);
	}

	/**
	 * Side bar links
	 */

	// array( url, name, extra css classes )
	$aside = Array(
		'site'	 =>	Array($a->get_baseurl()."/admin/site/", t("Site") , "site"),
		'users'	 =>	Array($a->get_baseurl()."/admin/users/", t("Users") , "users"),
		'plugins'=>	Array($a->get_baseurl()."/admin/plugins/", t("Plugins") , "plugins"),
		'update' =>	Array($a->get_baseurl()."/admin/update/", t("Update") , "update")
	);
	
	/* get plugins admin page */
	
	$r = q("SELECT * FROM `addon` WHERE `plugin_admin`=1");
	$aside['plugins_admin']=Array();
	foreach ($r as $h){
		$plugin =$h['name'];
		$aside['plugins_admin'][] = Array($a->get_baseurl()."/admin/plugins/".$plugin, $plugin, "plugin");
		// temp plugins with admin<commit_msg>do not under any circumstances allow a delegated forum admin to access the site admin page.<commit_after><?php

 /**
  * Friendica admin
  */
require_once("include/remoteupdate.php");
 
function admin_post(&$a){
	if(!is_site_admin()) {
		return;
	}


	if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
		return;
	
	// urls
	if ($a->argc > 1){
		switch ($a->argv[1]){
			case 'site':
				admin_page_site_post($a);
				break;
			case 'users':
				admin_page_users_post($a);
				break;
			case 'plugins':
				if ($a->argc > 2 && 
					is_file("addon/".$a->argv[2]."/".$a->argv[2].".php")){
						@include_once("addon/".$a->argv[2]."/".$a->argv[2].".php");
						if(function_exists($a->argv[2].'_plugin_admin_post')) {
							$func = $a->argv[2].'_plugin_admin_post';
							$func($a);
						}
				}
				goaway($a->get_baseurl() . '/admin/plugins/' . $a->argv[2] );
				return; // NOTREACHED
				break;
			case 'logs':
				admin_page_logs_post($a);
				break;
			case 'update':
				admin_page_remoteupdate_post($a);
				break;
		}
	}

	goaway($a->get_baseurl() . '/admin' );
	return; // NOTREACHED	
}

function admin_content(&$a) {

	if(!is_site_admin()) {
		return login(false);
	}

	if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
		return;

	/**
	 * Side bar links
	 */

	// array( url, name, extra css classes )
	$aside = Array(
		'site'	 =>	Array($a->get_baseurl()."/admin/site/", t("Site") , "site"),
		'users'	 =>	Array($a->get_baseurl()."/admin/users/", t("Users") , "users"),
		'plugins'=>	Array($a->get_baseurl()."/admin/plugins/", t("Plugins") , "plugins"),
		'update' =>	Array($a->get_baseurl()."/admin/update/", t("Update") , "update")
	);
	
	/* get plugins admin page */
	
	$r = q("SELECT * FROM `addon` WHERE `plugin_admin`=1");
	$aside['plugins_admin']=Array();
	foreach ($r as $h){
		$plugin =$h['name'];
		$aside['plugins_admin'][] = Array($a->get_baseurl()."/admin/plugins/".$plugin, $plugin, "plugin");
		// temp plugins with admin
{'fraction_non_alphanumeric': 0.23676431066917494, 'fraction_numerical': 0.005912389142703574, 'mean_word_length': 3.441527446300716, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2041007', 'n_tokens_mistral': 1656, 'n_tokens_neox': 1424, 'n_words': 236}