liquid_feedback_core

changeset 11:015825e225ca beta12

Version beta12

Changed function delete_private_data() to delete more data, including tables setting and member_image, for better data protection

Bugfix related to linux-sh in shell script lf_export

New fields password_reset_secret and password_reset_secret_expiry in member table

UNIQUE constraint for notify_email_secret and password_reset_secret fields in member table

Database constraint forbids adding yourself as a contact
author jbe
date Sat Jan 02 12:00:00 2010 +0100 (2010-01-02)
parents effdd7a04ea7
children a67c1cd4facf
files core.sql lf_export
line diff
     1.1 --- a/core.sql	Fri Dec 25 12:00:00 2009 +0100
     1.2 +++ b/core.sql	Sat Jan 02 12:00:00 2010 +0100
     1.3 @@ -6,7 +6,7 @@
     1.4  BEGIN;
     1.5  
     1.6  CREATE VIEW "liquid_feedback_version" AS
     1.7 -  SELECT * FROM (VALUES ('beta11', NULL, NULL, NULL))
     1.8 +  SELECT * FROM (VALUES ('beta12', NULL, NULL, NULL))
     1.9    AS "subquery"("string", "major", "minor", "revision");
    1.10  
    1.11  
    1.12 @@ -60,9 +60,11 @@
    1.13          "active"                BOOLEAN         NOT NULL DEFAULT TRUE,
    1.14          "admin"                 BOOLEAN         NOT NULL DEFAULT FALSE,
    1.15          "notify_email"          TEXT,
    1.16 -        "notify_email_unconfirmed"   TEXT,
    1.17 -        "notify_email_secret"        TEXT,
    1.18 -        "notify_email_secret_expiry" TIMESTAMPTZ,
    1.19 +        "notify_email_unconfirmed"     TEXT,
    1.20 +        "notify_email_secret"          TEXT     UNIQUE,
    1.21 +        "notify_email_secret_expiry"   TIMESTAMPTZ,
    1.22 +        "password_reset_secret"        TEXT     UNIQUE,
    1.23 +        "password_reset_secret_expiry" TIMESTAMPTZ,
    1.24          "name"                  TEXT            NOT NULL UNIQUE,
    1.25          "identification"        TEXT            UNIQUE,
    1.26          "organizational_unit"   TEXT,
    1.27 @@ -171,7 +173,9 @@
    1.28          PRIMARY KEY ("member_id", "other_member_id"),
    1.29          "member_id"             INT4            REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
    1.30          "other_member_id"       INT4            REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
    1.31 -        "public"                BOOLEAN         NOT NULL DEFAULT FALSE );
    1.32 +        "public"                BOOLEAN         NOT NULL DEFAULT FALSE,
    1.33 +        CONSTRAINT "cant_save_yourself_as_contact"
    1.34 +          CHECK ("member_id" != "other_member_id") );
    1.35  
    1.36  COMMENT ON TABLE "contact" IS 'Contact lists';
    1.37  
    1.38 @@ -2303,8 +2307,9 @@
    1.39            AND "direct_voter"."member_id" ISNULL
    1.40            AND "delegating_voter"."member_id" ISNULL
    1.41        LOOP
    1.42 -        INSERT INTO "direct_voter" ("member_id", "issue_id", "autoreject")
    1.43 -          VALUES ("member_id_v", "issue_id_p", TRUE);
    1.44 +        INSERT INTO "direct_voter"
    1.45 +          ("member_id", "issue_id", "weight", "autoreject") VALUES
    1.46 +          ("member_id_v", "issue_id_p", 1, TRUE);
    1.47          INSERT INTO "vote" (
    1.48            "member_id",
    1.49            "issue_id",
    1.50 @@ -2744,15 +2749,34 @@
    1.51        "issue_id_v" "issue"."id"%TYPE;
    1.52      BEGIN
    1.53        UPDATE "member" SET
    1.54 -        "login"                      = 'login' || "id"::text,
    1.55 -        "password"                   = NULL,
    1.56 -        "notify_email"               = NULL,
    1.57 -        "notify_email_unconfirmed"   = NULL,
    1.58 -        "notify_email_secret"        = NULL,
    1.59 -        "notify_email_secret_expiry" = NULL;
    1.60 +        "login"                        = 'login' || "id"::text,
    1.61 +        "password"                     = NULL,
    1.62 +        "notify_email"                 = NULL,
    1.63 +        "notify_email_unconfirmed"     = NULL,
    1.64 +        "notify_email_secret"          = NULL,
    1.65 +        "notify_email_secret_expiry"   = NULL,
    1.66 +        "password_reset_secret"        = NULL,
    1.67 +        "password_reset_secret_expiry" = NULL,
    1.68 +        "organizational_unit"          = NULL,
    1.69 +        "internal_posts"               = NULL,
    1.70 +        "realname"                     = NULL,
    1.71 +        "birthday"                     = NULL,
    1.72 +        "address"                      = NULL,
    1.73 +        "email"                        = NULL,
    1.74 +        "xmpp_address"                 = NULL,
    1.75 +        "website"                      = NULL,
    1.76 +        "phone"                        = NULL,
    1.77 +        "mobile_phone"                 = NULL,
    1.78 +        "profession"                   = NULL,
    1.79 +        "external_memberships"         = NULL,
    1.80 +        "external_posts"               = NULL,
    1.81 +        "statement"                    = NULL;
    1.82 +      -- "text_search_data" is updated by triggers
    1.83        DELETE FROM "session";
    1.84        DELETE FROM "invite_code" WHERE "used" ISNULL;
    1.85        DELETE FROM "contact" WHERE NOT "public";
    1.86 +      DELETE FROM "setting";
    1.87 +      DELETE FROM "member_image";
    1.88        DELETE FROM "direct_voter" USING "issue"
    1.89          WHERE "direct_voter"."issue_id" = "issue"."id"
    1.90          AND "issue"."closed" ISNULL;
     2.1 --- a/lf_export	Fri Dec 25 12:00:00 2009 +0100
     2.2 +++ b/lf_export	Sat Jan 02 12:00:00 2010 +0100
     2.3 @@ -19,6 +19,7 @@
     2.4      echo "Dumping and compressing copied database to \"$2\"..."
     2.5      if pg_dump --no-owner --no-privileges "$EXPORT_DBNAME" | gzip -9 > "$2"
     2.6      then
     2.7 +      true
     2.8      else
     2.9        retval=4
    2.10      fi

Impressum / About Us