Projet

Général

Profil

« Précédent | Suivant » 

Révision 69f21f64

Ajouté par Thomas Noël il y a plus de 9 ans

idp: management interface

Voir les différences:

usr/local/www/services_captiveportal_saml_idp.php
44 44
require_once("filter.inc");
45 45
require_once("shaper.inc");
46 46
require_once("captiveportal.inc");
47
require_once("captiveportal_saml.inc");
47 48

  
48 49
if (!is_array($config['captiveportal']))
49 50
	$config['captiveportal'] = array();
......
56 57
$a_un =& $config['univnautes'];
57 58

  
58 59
if (!is_array($a_un['idp']))
59
        $a_un['idp'] = array();
60
	$a_un['idp'] = array();
60 61
$a_idp =& $a_un['idp'];
61 62

  
62 63
$pconfig['certref'] = $a_idp['certref'];
64
$pconfig['enable'] = isset($a_idp['enable']);
63 65

  
64 66
$pgtitle = array(gettext("Services"),gettext("Captive portal"), "SAML 2.0 Identity provider");
65 67
$shortcut_section = "captiveportal";
......
71 73

  
72 74
	/* input validation */
73 75
        $reqdfields = array("certref");
74
        $reqdfieldsn = array(gettext("IdP SAML 2.0 Certificate"));
76
	$reqdfieldsn = array(gettext("IdP SAML 2.0 Certificate"));
75 77

  
76 78
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
77 79

  
......
81 83
                exit;
82 84
        }
83 85

  
84
        if (!$input_errors) {
85
                $a_idp['certref'] = $pconfig['certref'];
86
                /* write config.xml */
87
                write_config();
88

  
89
                /* relaunch IdP */
90

  
91
                /* back to the page */
92
                pfSenseHeader("services_captiveportal_saml_idp.php");
93
        }
94

  
86
	if (!$input_errors) {
87
		if ($_POST['enable'])
88
			$a_idp['enable'] = true;
89
		else
90
			unset($a_idp['enable']);
91
		$a_idp['certref'] = $pconfig['certref'];
92
		/* write config.xml */
93
		write_config();
94

  
95
		/* relaunch IdP */
96
		mwexec_bg("/usr/local/univnautes/idp/rc.sh restart");
97

  
98
		/* back to the page */
99
		pfSenseHeader("services_captiveportal_saml_idp.php");
100
	}
95 101
}
96 102
include("head.inc");
97 103
?>
......
103 109
<form action="services_captiveportal_saml_idp.php" method="post" enctype="multipart/form-data" name="iform" id="iform">
104 110

  
105 111
<table width="100%" border="0" cellpadding="0" cellspacing="0">
106
  <tr><td class="tabnavtbl">
107
<?php
108
	$tab_array = array();
109
	$tab_array[] = array(gettext("Service provider"), false, "services_captiveportal_saml_sp.php");
110
	$tab_array[] = array(gettext("Identity provider"), true, "services_captiveportal_saml_idp.php");
111
	$tab_array[] = array(gettext("Federations"), false, "services_captiveportal_saml_federation.php");
112
	display_top_tabs($tab_array, true);
113
?>    </td></tr>
112
  <tr><td class="tabnavtbl"><?php display_saml_tabs(basename(__FILE__)); ?></td></tr>
114 113
  <tr>
115 114
  <td class="tabcont">
116 115
  <table width="100%" border="0" cellpadding="6" cellspacing="0">
116

  
117
	<tr>
118
		<td colspan="2" class="list" height="12"></td>
119
	</tr>
120
	<tr>
121
		<td colspan="2" valign="top" class="listtopic"><?=gettext("Identity Provider SAML 2.0");?></td>
122
	</tr>
123

  
124
	<tr>
125
		<td width="22%" valign="top" class="vtable">&nbsp;</td>
126
		<td width="78%" class="vtable">
127
		<input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?>><strong><?=gettext("Enable"); ?> </strong></td>
128
	</tr>
129

  
117 130
	<tr>
118 131
		<td width="22%" valign="top" class="vncell"><?=gettext("IdP SAML 2.0 Certificate"); ?></td>
119 132
		<td width="78%" class="vtable">
120 133
			<?php if (count($a_cert)): ?>
121 134
			<select name="certref" id="certref" class="formselect">
122
				<option value="__none__">None</option>
135
                        <option value="__none__">None</option>
123 136
				<?php
124 137
					foreach($a_cert as $cert):
125 138
						$selected = "";
......
129 142
				<option value="<?=$cert['refid'];?>"<?=$selected;?>><?=$cert['descr'];?></option>
130 143
			<?php endforeach; ?>
131 144
			</select>
145
                                (go to <a href="system_certmanager.php">System &gt; Cert Manager</a> to create a new one)
132 146
			<?php else: ?>
133 147
				<b><?=gettext("No Certificates defined."); ?></b> <br/>Create one under <a href="system_certmanager.php">System &gt; Cert Manager</a>.
134 148
			<?php endif; ?>
135 149
		</td>
136 150
	</tr>
151
	<tr>
152
		<td colspan="2" class="list" height="12"></td>
153
	</tr>
137 154

  
138 155
	<tr>
139 156
	  <td width="22%" valign="top">&nbsp;</td>
140 157
	  <td width="78%">
141
		<?php echo "<input name='zone' id='zone' type='hidden' value='" . htmlspecialchars($cpzone) . "'/>"; ?>
142 158
		<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onClick="enable_change(true)">
143 159
		<a href="services_captiveportal_zones.php"><input name="Cancel" type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onClick="enable_change(true)"></a>
144 160
	  </td>
......
148 164
  </tr>
149 165
  </table>
150 166
</form>
167

  
168
<p>
169
See also: <a href="system_usermanager.php">User Manager</a>.
170
</p>
171

  
151 172
<script language="JavaScript">
152 173
<!--
153 174
enable_change(false);

Formats disponibles : Unified diff