Conditions | 11 |
Paths | 128 |
Total Lines | 105 |
Code Lines | 80 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
65 | private function setMessages() { |
||
66 | // SUPPORT |
||
67 | $h = "<p>" . _("This section can be used to upload specific Terms of Use for your users and to display details of how your users can reach your local helpdesk.") . "</p>"; |
||
68 | if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] == "LOCAL") { |
||
69 | $h .= "<p>" . |
||
70 | sprintf(_("Do you provide helpdesk services for your users? If so, it would be nice if you would tell us the pointers to this helpdesk."), $this->nomenclatureParticipant) . "</p>" . |
||
71 | "<p>" . |
||
72 | _("If you enter a value here, it will be added to the installers for all your users, and will be displayed on the download page. If you operate separate helpdesks for different user groups (we call this 'profiles') specify per-profile helpdesk information later in this wizard. If you operate no help desk at all, just leave these fields empty.") . "</p>"; |
||
73 | if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL") { |
||
74 | $h .= "<p>" . sprintf(_("For %s deployments, providing at least a local e-mail contact is required."), \config\ConfAssistant::SILVERBULLET['product_name']) . " " . _("This is the contact point for your organisation. It may be displayed publicly.") . "</p>"; |
||
75 | } |
||
76 | } elseif (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL") { |
||
77 | $h .= "<p>" . _("Providing at least a local support e-mail contact is required.") . " " . _("This is the contact point for your end users' level 1 support.") . "</p>"; |
||
78 | } |
||
79 | $this->helpMessage['support'] = $h; |
||
80 | |||
81 | // MEDIA |
||
82 | $h = "<p>" . |
||
83 | sprintf(_("In this section, you define on which media %s should be configured on user devices."), \config\ConfAssistant::CONSORTIUM['display_name']) . "</p><ul>"; |
||
84 | $h .= "<li>"; |
||
85 | $h .= "<strong>" . ( count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0 ? _("Additional SSIDs:") : _("SSIDs:")) . " </strong>"; |
||
86 | if (count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0) { |
||
87 | $ssidlist = ""; |
||
88 | foreach (\config\ConfAssistant::CONSORTIUM['ssid'] as $ssid) { |
||
89 | $ssidlist .= ", '<strong>" . $ssid . "</strong>'"; |
||
90 | } |
||
91 | $ssidlist = substr($ssidlist, 2); |
||
92 | $h .= sprintf(ngettext("We will always configure this SSID for WPA2/AES: %s.", "We will always configure these SSIDs for WPA2/AES: %s.", count(\config\ConfAssistant::CONSORTIUM['ssid'])), $ssidlist); |
||
93 | $h .= "<br/>" . sprintf(_("It is also possible to define custom additional SSIDs with the option '%s' below."), $this->displayName("media:SSID")); |
||
94 | } else { |
||
95 | $h .= _("Please configure which SSIDs should be configured in the installers."); |
||
96 | } |
||
97 | $h .= " " . _("By default, we will only configure the SSIDs with WPA2/AES encryption. By using the '(with WPA/TKIP)' option you can specify that we should include legacy support for WPA/TKIP where possible."); |
||
98 | $h .= "</li>"; |
||
99 | |||
100 | $h .= "<li>"; |
||
101 | $h .= "<strong>" . ( count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0 ? _("Additional Hotspot 2.0 / Passpoint Consortia:") : _("Hotspot 2.0 / Passpoint Consortia:")) . " </strong>"; |
||
102 | if (count(\config\ConfAssistant::CONSORTIUM['interworking-consortium-oi']) > 0) { |
||
103 | $consortiumlist = ""; |
||
104 | foreach (\config\ConfAssistant::CONSORTIUM['interworking-consortium-oi'] as $oi) { |
||
105 | $consortiumlist .= ", '<strong>" . $oi . "</strong>'"; |
||
106 | } |
||
107 | $consortiumlist = substr($consortiumlist, 2); |
||
108 | $h .= sprintf(ngettext("We will always configure this Consortium OI: %s.", "We will always configure these Consortium OIs: %s.", count(\config\ConfAssistant::CONSORTIUM['interworking-consortium-oi'])), $consortiumlist); |
||
109 | |||
110 | $h .= "<br/>" . sprintf(_("It is also possible to define custom additional OIs with the option '%s' below."), $this->displayName("media:consortium_OI")); |
||
111 | } else { |
||
112 | $h .= _("Please configure which Consortium OIs should be configured in the installers."); |
||
113 | } |
||
114 | $h .= "</li>"; |
||
115 | $h .= "<li><strong>" . _("Support for wired IEEE 802.1X:") . " </strong>" |
||
116 | . _("If you want to configure your users' devices with IEEE 802.1X support for wired ethernet, please check the corresponding box. Note that this makes the installation process a bit more difficult on some platforms (Windows: needs administrator privileges; Apple: attempting to install a profile with wired support on a device without an active wired ethernet card will fail).") . |
||
117 | "</li>"; |
||
118 | $h .= "<li><strong>" . _("Removal of bootstrap/onboarding SSIDs:") . " </strong>" |
||
119 | . _("If you use a captive portal to distribute configurations, you may want to unconfigure/disable that SSID after the bootstrap process. With this option, the SSID will either be removed, or be defined as 'Only connect manually'.") |
||
120 | . "</li>"; |
||
121 | $h .= "</ul>"; |
||
122 | $this->helpMessage['media'] = $h; |
||
123 | |||
124 | // IDP GENERAL |
||
125 | $h = "<p>" . |
||
126 | _("Some properties are valid across all deployment profiles. This is the place where you can describe those properties in a fine-grained way. The solicited information is used as follows:") . "</p>". |
||
127 | "<ul>". |
||
128 | "<li>"._("<strong>Logo</strong>: When you submit a logo, we will embed this logo into all installers where a custom logo is possible. We accept any image format, but for best results, we suggest SVG. If you don't upload a logo, we will use the generic logo instead (see top-right corner of this page).") . "</li>". |
||
129 | "<li>".sprintf(_("<strong>Name</strong>: The %s may have names in multiple languages. It is recommended to always populate at least the 'default/other' language, as it is used as a fallback if the system does not have a name in the exact language the user requests a download in."), $this->nomenclatureParticipant) . "</li>". |
||
130 | "</ul>"; |
||
131 | $this->helpMessage['idp_general'] = $h; |
||
132 | |||
133 | // PROFILE GENERAL |
||
134 | $h = "<p>" . _("First of all we need a name for the profile. This will be displayed to end users, so you may want to choose a descriptive name like 'Professors', 'Students of the Faculty of Bioscience', etc.") . "</p>". |
||
135 | "<p>" . _("Optionally, you can provide a longer descriptive text about who this profile is for. If you specify it, it will be displayed on the download page after the user has selected the profile name in the list.") . "</p>". |
||
136 | "<p>" . _("You can also tell us your RADIUS realm. "); |
||
137 | if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] !== NULL) { |
||
138 | $h .= sprintf(_("This is useful if you want to use the sanity check module later, which tests reachability of your realm in the %s infrastructure. "), \config\ConfAssistant::CONSORTIUM['display_name']); |
||
139 | } |
||
140 | $h .= _("It is required to enter the realm name if you want to support anonymous outer identities (see below).") . "</p>"; |
||
141 | $this->helpMessage['profile'] = $h; |
||
142 | |||
143 | // REALM |
||
144 | $h = "<p>".sprintf(_("Some installers support a feature called 'Anonymous outer identity'. If you don't know what this is, please read <a href='%s'>this article</a>."), "https://confluence.terena.org/display/H2eduroam/eap-types")."</p>". |
||
145 | "<p>"._("On some platforms, the installers can suggest username endings and/or verify the user input to contain the realm suffix.")."</p>". |
||
146 | "<p>"._("The realm check feature needs to know an outer ID which actually gets a chance to authenticate. If your RADIUS server lets only select usernames pass, it is useful to supply the information which of those (outer ID) username we can use for testing.")."</p>"; |
||
147 | $this->helpMessage['realm'] = $h; |
||
148 | |||
149 | // REDIRECT |
||
150 | $h ="<p>"._("The CAT has a download area for end users. There, they will, for example, learn about the support pointers you entered earlier. The CAT can also immediately offer the installers for the profile for download. If you don't want that, you can instead enter a web site location where you want your users to be redirected to. You, as the administrator, can still download the profiles to place them on that page (see the 'Compatibility Matrix' button on the dashboard).") . "</p>"; |
||
151 | $this->helpMessage['redirect'] = $h; |
||
152 | |||
153 | // EAP |
||
154 | $h = "<p>"._("Now, we need to know which EAP types your IdP supports. If you support multiple EAP types, you can assign every type a priority (1=highest). This tool will always generate an automatic installer for the EAP type with the highest priority; only if the user's device can't use that EAP type, we will use an EAP type further down in the list.") . "</p>"; |
||
155 | $this->helpMessage['eap_support'] = $h; |
||
156 | |||
157 | // LOCATIOM |
||
158 | $h = "<p>" . |
||
159 | _("The user download interface (see <a href='../'>here</a>), uses geolocation to suggest possibly matching IdPs to the user. The more precise you define the location here, the easier your users will find you.") . |
||
160 | "</p> |
||
161 | <ul>" . |
||
162 | _("<li>Drag the marker in the map to your place, or</li> |
||
163 | <li>enter your street address in the field below for lookup, or</li> |
||
164 | <li>use the 'Locate Me!' button</li>") . |
||
165 | "</ul> |
||
166 | <strong>" . |
||
167 | _("We will use the coordinates as indicated by the marker for geolocation.") . |
||
168 | "</strong>"; |
||
169 | $this->helpMessage['location'] = $h; |
||
170 | } |
||
173 |