diff --git a/doc/account_control.php b/doc/account_control.php new file mode 100644 index 0000000000..ccaa8faee6 --- /dev/null +++ b/doc/account_control.php @@ -0,0 +1,64 @@ +Disabling account creation + +To disable all account creation, +edit the project configuration file config.xml and add to it the element: +
+<disable_account_creation>1</disable_account_creation> ++This disables account creation via any mechanism +(the client, the web, or account managers). +You can momentarily remove this element while you create accounts. + +
+It is also possible to restrict account creation to only those +who present a secret 'invitation code'. +In this case an account can only be created via the web pages, +not via the client or an account manager. + +
+To use this mechanism you need to add to the file html/project/project.inc +a definition for a PHP pre-processor symbol INVITE_CODES +containing the allowed invitation codes. +A simple example is: +
+define('INVITE_CODES', '/xyzzy/'); ++This allows account creation only if the user enters the invitation code +'xyzzy' (without any quotes). +The pattern in INVITE_CODES is compared to the user's input as a +Perl-Compatible Regular Expression (PCRE), +so don't forget the enclosing slashes. +A more complicated example is: +
+define('INVITE_CODES', '/yohoho|blunderbuss|!grog4U/'); ++In a PCRE vertical bars separate alternatives, +so this pattern just allows someone to create an account +if they enter any of the words 'yohoho', 'blunderbuss', or '!grog4U'. +More complex pattern matching is possible, though not required. + +
+The security of this mechanism depends on how
+you distribute the invitation codes.
+If you write the code on the whiteboard in your lab then only
+someone with access to that room can use it.
+If you send it out to a mailing list then only members of that list can use it
+(until someone shares it with someone else who is not on the list).
+The goal here is not strict security so much as a way for a new project
+to limit account creation to a restricted set of users
+while the project is getting started.
+";
+page_tail();
+?>
diff --git a/doc/validate_advanced.php b/doc/validate_advanced.php
new file mode 100644
index 0000000000..71f9f88e31
--- /dev/null
+++ b/doc/validate_advanced.php
@@ -0,0 +1,84 @@
+",
+htmlspecialchars("
+int check_set(
+ vector
+Note: use BOINC's
+back-end utility functions
+to get file pathnames
+and to distinguish recoverable and nonrecoverable file-open errors.
+
+
+Neither function should delete files or access the BOINC database.
+
+A more detailed description is here.
+";
+page_tail();
+?>
diff --git a/doc/validate_simple.php b/doc/validate_simple.php
new file mode 100644
index 0000000000..283425f488
--- /dev/null
+++ b/doc/validate_simple.php
@@ -0,0 +1,94 @@
+
+
+You must link these functions with the files
+validator.C, validate_util.C, and validate_util2.C.
+The result is your custom validator.
+
+
+This example uses utility functions
+get_output_file_path() and try_fopen(),
+which are documented here.
+"; block_start(); echo "
+struct DATA {
+ int i;
+ double x;
+};
+
+int init_result(RESULT& result, void*& data) {
+ FILE* f;
+ string path;
+ int i, n, retval;
+ double x;
+
+ retval = get_output_file_path(result, path);
+ if (retval) return retval;
+ retval = try_fopen(path.c_str(), f, \"r\");
+ if (retval) return retval;
+ n = fscanf(f, \"%d %f\", &i, &x);
+ if (n != 2) return ERR_XML_PARSE;
+ DATA* dp = new DATA;
+ dp->i = i;
+ dp->x = x;
+ data = (void*) dp;
+ return 0;
+}
+
+int compare_results2(
+ RESULT& r1, void* _data1, RESULT& r2, void* _data2, bool& match
+) {
+ DATA* data1 = (DATA*)_data1;
+ DATA* data2 = (DATA*)_data2;
+ match = true;
+ if (data1->i != data2->i) match = false;
+ if (fabs(data1->x - data2->x) > 0.01) match = false;
+ return 0;
+}
+
+int cleanup_result(RESULT& r, void* data) {
+ if (data) free(data);
+ return 0;
+}
+
+"; block_end(); echo "
+";
+page_tail();
+?>
+
+",
+htmlspecialchars("
+int check_pair(RESULT& new_result, RESULT& canonical_result, bool& retry);
+"),
+"
+
+
+
+Example
+Here's an example in which the output file
+contains an integer and a double.
+Two results are considered equivalent if the integer is equal
+and the doubles differ by no more than 0.01.
+