Lines Matching refs:policy
44 $policy = plugin_load('helper', 'passpolicy');
45 $policy->min_pools = $minp;
46 $policy->min_length = $minl;
47 $policy->usepools = array(
53 $policy->usernamecheck = $ucheck;
54 $policy->pronouncable = $pron;
55 $policy->nocommon = $nocom;
56 $policy->noleaked = $noleak;
58 return $policy;
63 $policy = $this->newPolicy(6, 1, true, true, true, true, 0);
64 …$this->assertTrue($policy->checkPolicy('tested', 'tested'), '1 pool, no user check ' . $policy->er…
65 $this->assertFalse($policy->checkPolicy('test', 'tested'),
66 '1 pool, no user check, but too short ' . $policy->error);
67 $this->assertEquals(\helper_plugin_passpolicy::LENGTH_VIOLATION, $policy->error);
68 …$this->assertTrue($policy->checkPolicy('tested99!', 'tested'), '1 pool, no user check ' . $policy-…
70 $policy = $this->newPolicy(6, 3, true, true, true, true, 0);
71 …$this->assertFalse($policy->checkPolicy('tested', 'tested'), '3 pools, no user check ' . $policy->…
72 $this->assertEquals(\helper_plugin_passpolicy::POOL_VIOLATION, $policy->error);
73 …$this->assertTrue($policy->checkPolicy('tested99!', 'tested'), '3 pools, no user check ' . $policy…
75 $policy = $this->newPolicy(6, 1, true, true, true, true, 2);
76 …$this->assertFalse($policy->checkPolicy('tested', 'tested'), '1 pool, user check ' . $policy->erro…
77 $this->assertEquals(\helper_plugin_passpolicy::USERNAME_VIOLATION, $policy->error);
78 …$this->assertFalse($policy->checkPolicy('tested99!', 'tested'), '1 pool, user check ' . $policy->e…
79 $this->assertEquals(\helper_plugin_passpolicy::USERNAME_VIOLATION, $policy->error);
80 …$this->assertFalse($policy->checkPolicy('tested', 'untested'), '1 pool, user check ' . $policy->er…
81 $this->assertEquals(\helper_plugin_passpolicy::USERNAME_VIOLATION, $policy->error);
82 …$this->assertFalse($policy->checkPolicy('tested99!', 'comptessa'), '1 pool1, user check ' . $polic…
83 $this->assertEquals(\helper_plugin_passpolicy::USERNAME_VIOLATION, $policy->error);
88 $policy = $this->newPolicy(6, 1, true, true, true, true, 0, true, true);
89 $this->assertTrue($policy->checkPolicy('bazzel', 'nope'));
90 $this->assertFalse($policy->checkPolicy('eyphed', 'nope'));
91 $this->assertEquals(\helper_plugin_passpolicy::COMMON_VIOLATION, $policy->error);
93 $policy->nocommon = false;
94 $this->assertTrue($policy->checkPolicy('password', 'nope'));
99 $policy = $this->newPolicy(6, 1, true, true, true, true, 0, false, true, true);
100 $this->assertTrue($policy->checkPolicy('sadf asfd s as asf a afafaa fadfsa fas', 'nope'));
101 $this->assertFalse($policy->checkPolicy('qwertzuiop', 'nope'));
102 $this->assertEquals(\helper_plugin_passpolicy::LEAK_VIOLATION, $policy->error);
104 $policy->noleaked = false;
105 $this->assertTrue($policy->checkPolicy('qwertzuiop', 'nope'));
110 $policy = $this->newPolicy(3, 0, true, true, true, true, 0);
111 …$this->assertTrue($policy->checkPolicy('lowerUPPER123!"', 'tester'), '0 required, 4 given ' . $pol…
112 …$this->assertTrue($policy->checkPolicy('lowerUPPER123', 'tester'), '0 required, 3 given ' . $polic…
113 …$this->assertTrue($policy->checkPolicy('lowerUPPER', 'tester'), '0 required, 2 given ' . $policy->…
114 …$this->assertTrue($policy->checkPolicy('lower', 'tester'), '0 required, 1 given ' . $policy->error…
116 $policy = $this->newPolicy(3, 1, true, true, true, true, 0);
117 …$this->assertTrue($policy->checkPolicy('lowerUPPER123!"', 'tester'), '1 required, 4 given ' . $pol…
118 …$this->assertTrue($policy->checkPolicy('lowerUPPER123', 'tester'), '1 required, 3 given ' . $polic…
119 …$this->assertTrue($policy->checkPolicy('lowerUPPER', 'tester'), '1 required, 2 given ' . $policy->…
120 …$this->assertTrue($policy->checkPolicy('lower', 'tester'), '1 required, 1 given ' . $policy->error…
122 $policy = $this->newPolicy(3, 2, true, true, true, true, 0);
123 …$this->assertTrue($policy->checkPolicy('lowerUPPER123!"', 'tester'), '2 required, 4 given ' . $pol…
124 …$this->assertTrue($policy->checkPolicy('lowerUPPER123', 'tester'), '2 required, 3 given ' . $polic…
125 …$this->assertTrue($policy->checkPolicy('lowerUPPER', 'tester'), '2 required, 2 given ' . $policy->…
126 …$this->assertFalse($policy->checkPolicy('lower', 'tester'), '2 required, 1 given ' . $policy->erro…
127 $this->assertEquals(\helper_plugin_passpolicy::POOL_VIOLATION, $policy->error);
129 $policy = $this->newPolicy(3, 3, true, true, true, true, 0);
130 …$this->assertTrue($policy->checkPolicy('lowerUPPER123!"', 'tester'), '3 required, 4 given ' . $pol…
131 …$this->assertTrue($policy->checkPolicy('lowerUPPER123', 'tester'), '3 required, 3 given ' . $polic…
132 …$this->assertFalse($policy->checkPolicy('lowerUPPER', 'tester'), '3 required, 2 given ' . $policy-…
133 $this->assertEquals(\helper_plugin_passpolicy::POOL_VIOLATION, $policy->error);
134 …$this->assertFalse($policy->checkPolicy('lower', 'tester'), '3 required, 1 given ' . $policy->erro…
135 $this->assertEquals(\helper_plugin_passpolicy::POOL_VIOLATION, $policy->error);
137 $policy = $this->newPolicy(3, 4, true, true, true, true, 0);
138 …$this->assertTrue($policy->checkPolicy('lowerUPPER123!"', 'tester'), '4 required, 4 given ' . $pol…
139 …$this->assertFalse($policy->checkPolicy('lowerUPPER123', 'tester'), '4 required, 3 given ' . $poli…
140 $this->assertEquals(\helper_plugin_passpolicy::POOL_VIOLATION, $policy->error);
141 …$this->assertFalse($policy->checkPolicy('lowerUPPER', 'tester'), '4 required, 2 given ' . $policy-…
142 $this->assertEquals(\helper_plugin_passpolicy::POOL_VIOLATION, $policy->error);
143 …$this->assertFalse($policy->checkPolicy('lower', 'tester'), '4 required, 1 given ' . $policy->erro…
144 $this->assertEquals(\helper_plugin_passpolicy::POOL_VIOLATION, $policy->error);
149 $policy = $this->newPolicy(6, 4, true, true, true, true, 0, true);
150 $pw1 = $policy->generatePassword('test');
151 $pw2 = $policy->generatePassword('test');
160 $policy = $this->newPolicy(18, 4, true, true, true, true, 0, true);
161 $pw1 = $policy->generatePassword('test');
162 $pw2 = $policy->generatePassword('test');
171 $policy = $this->newPolicy(6, 4, true, true, true, true, 0, false);
172 $pw1 = $policy->generatePassword('test');
173 $pw2 = $policy->generatePassword('test');
182 $policy = $this->newPolicy(18, 4, true, true, true, true, 0, false);
183 $pw1 = $policy->generatePassword('test');
184 $pw2 = $policy->generatePassword('test');
193 $policy = $this->newPolicy(18, 1, false, false, false, true, 0, false);
194 $pw1 = $policy->generatePassword('test');
195 $pw2 = $policy->generatePassword('test');
204 $policy = $this->newPolicy(18, 1, false, false, true, false, 0, false);
205 $pw1 = $policy->generatePassword('test');
206 $pw2 = $policy->generatePassword('test');
215 $policy = $this->newPolicy(18, 1, false, true, false, false, 0, false);
216 $pw1 = $policy->generatePassword('test');
217 $pw2 = $policy->generatePassword('test');
226 $policy = $this->newPolicy(18, 1, true, false, false, false, 0, false);
227 $pw1 = $policy->generatePassword('test');
228 $pw2 = $policy->generatePassword('test');